I am making a custom Python distribution for Windows. The basic idea is that I collect the packages together on my PC and then generate an executable installer which I distribute, and when run it copies the distribution to an install location on the host PC.
It works fine for most libraries but I have found that for libraries with standalone executables, most notably IPython, the 'secondary' executables end up looking for the primary Python executable in the wrong place - specifically, on the path where the distribution was created, rather than where it was subsequently installed.
For example, suppose I create the distribution in C:\Dev\ and install to C:\Python\ (on a different PC). Then I get an error like:
C:\Python\Scripts\ipython.exe
Fatal error in launcher: Unable to create process using "C:\Dev\python.exe" "C:\Python\Scripts\ipython.exe"
On the other hand, executing Ipython via imports with C:\Python\python.exe -m IPython works fine.
Peering into the ipython.exe file I see that the original path "C:\Dev\python.exe" has been hard-coded inside it, presumably when it was installed by pip.
Is there a way to specify the (eventual) install path of python.exe instead the dev path when using pip? Or is there another way to solve this problem?
pipafter installing on the different PC?