Script to convert an Python package into an portable version
- Download python package from official Website
- Extract the package in a directory. Example: python3.11.4/
- Download "prepare-portable-python.py" from this source and put it in the same root directory as python3.11.4
- Open "prepare-portable-python.py" and edit PYTHONDIR and PYTHONPTHNAME so it meets the downloaded Python version. And Edit DEPENDENCIES for all dependencies which needs to be installed.
- Run script
- Directory python3.11.4/Lib/site-packages will be created
- python._pth file will be edited
- pip will be installed in this directory
- The Dependencies will be installed in this directory
Possible uses:
- You can add the Path to pythonw.exe as PATH Environment Variable.
- If you have any other Python version installed on your system, you just add following on top of your python lanuch code (assuming its in the same root directory as the directory of step 2):
#!python3.11.4\pythonw.exe