Skip to content

About

This project will help you quickly create a portable version of your python project

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Portable Project Creator

English Russian

Changelog

For all updates and changes, please refer to the Releases.

About

This tool allows you to create portable Python environments that can be easily distributed as archives. It streamlines the process of setting up and sharing Python projects with minimal configuration.

Demo

See the Demo or Demo_RU.MD for a step-by-step guide on creating a portable environment based on the stable-diffusion-webui-amdgpu project.

Getting Started

  1. Download the Python Portable Project Creator:

    • Download the latest release from Releases
  2. Extract the downloaded archive to your desired location.

  3. Copy your project files into the your-project folder within the extracted structure.

Project Structure

project-root/
│
├── system/
│   ├── python/
│   ├── git/
│   ├── ffmpeg/
│   ├── ssh/
│   └── user/
│
├── your-project/
│
├── tmp/
│
├── activate.bat
├── clone.bat
├── env.bat
├── run.bat
├── update.bat

Configuration

  1. Configure env.bat: Edit the following variables:

    • APP_FOLDER: Name of your project folder
    • REPO_URL: URL of your Git repository
    • RESET_WHEN_UPDATE: Set to "true" to reset changes on update
    • PRIVATE_REPO: Set to "true" for private repositories
    • GITHUB_SSH_PATH: Path to your SSH key (default is id_ed, change if different)
    • CLEAR_TEMP_EVERY_RUN: Set to "true" to clear temporary files before each run (default)
  2. For private repositories:

    • Create the system/ssh folder if it doesn't exist.
    • Add your SSH key to system/ssh.
    • Ensure PRIVATE_REPO=true in env.bat.
    • Update REPO_URL in env.bat to use the SSH URL.
  3. Run activate.bat to set up the Python environment.

  4. Install dependencies: In the activated environment, run:

    pip install -r requirements.txt
    

    Note: Always use python -m pip not pip.

    Update: In the latest update, you can use the standard pip. You can download the latest version of the code from GitHub.

  5. Configure run.bat: Specify your main Python file and any command-line arguments.

  6. Test the setup: Run your project using run.bat.

  7. Prepare for distribution:

    • Delete activate.bat and clone.bat.
    • Compress the entire folder into an archive.

Additional Information

  • This setup uses a portable Python installation instead of a traditional venv.
  • To change the Python version, refer to system/README.md.
  • The project includes a portable Git installation for version control.
  • You can customize env.bat with additional variables as needed.
  • If you realize that you've messed up your environment, you can go to the system folder and reinstall Python using the reinstall_python.bat file. This will reset your environment.

This semi-automated setup allows for quick deployment of portable Python environments while providing flexibility for project-specific configurations.

About

This project will help you quickly create a portable version of your python project

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages