This repository provides a Portable Python environment that supports running any Python app with Tkinter, directly via a Run.bat
script. Unlike many Portable Python versions, this one includes Tkinter support, enabling GUI-based applications out of the box.
-
Copy Files: Place the
PythonPortable
folder,Run.bat
andInstall_additional_modules.bat
into the same directory as the script you wish to run. -
Install Additional Modules: Run
Install_additional_modules.bat
to install any required Python modules. You can edit this script to specify additionalpip install
commands as needed. -
Edit
Run.bat
: OpenRun.bat
and setSCRIPT_NAME
to the name of the script you want to execute. -
Run Your Script: Double-click
Run.bat
to launch your specified Python script.
To create a PythonPortable environment from scratch, follow these steps:
-
Run Installation: Execute
Installation.bat
, which will download and set up a Portable Python environment. -
Enable Tkinter Support:
-
Download the same Python version as the embedded distribution, and install it locally.
-
Copy the following files from your regular Python installation to the appropriate folders in
PythonPortable
:tcl
folder →PythonPortable\
(root folder)tkinter
folder (fromLib
) →PythonPortable\Lib\
orPythonPortable\
- DLL files:
_tkinter.pyd
,tcl86t.dll
,tk86t.dll
,zlib1.dll
(for Python ≥ 3.12) →PythonPortable\DLLs\
orPythonPortable\
(this one in my case)
-
For more details, refer to this Stack Overflow thread.
Note: You may face issues when accessing files using PythonPortable. To solve this add this to you the beggining of your main.py: import os import sys sys.path.append(os.path.dirname(os.path.abspath(file)))