Changing path to python in pip.exe, ipython.exe, etc

Olivier B. perso.olivier.barthelemy at gmail.com
Thu Apr 25 10:13:26 EDT 2024


I am building a python work environment where
 - i build python from sources
 - install pip with the wheel bundled with python
 - then install things with pip, like Jupyter

That environment is then deployed on various machines, at various
installation folders.

One issue I encounter, is the path to python in scripts like pip,
ipython, jupyter, etc is the original path where python is installed.
On linux, i can just do some sed in the problematic scripts.
On windows however, those scripts are python embedded in an EXE.
Probably generated by the same tool, as they all have a similar size
and a structure of an exe that contains a compressed __main__.py that
launch the relevant python module for the command.

What is the tool that creates those executables, and is there a way to
regenerate them from the python that has been deployed somewhere else,
so they point to the correct final path to python on that machine?
 Since pip is able to create ipython.exe with path to my python
embedded for example, i assume i already have all i need in my python
installation to regenerate them?


More information about the Python-list mailing list