Python Forum
Python broken if moved to a different folder
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python broken if moved to a different folder
#1
Hi,

I'm building a installer to redistribute inside my company Scons with some special tools developed in-house. The idea is to have an environment with Python, SCons and our in-house tools independent of any other Python installation. I'm using InnoSetup as installer. We are using Windows OS.

I found that I cannot change the Python installation directory without breaking the "exe's"under %Python%\Scripts. But then I realized that by fixing the shebang of the *-script.py files the problem was solved. So I adapt my Inno scripts to fix this automatically and everything worked ok.

Now I wanted to do a new install with Python 3.8 (prior was Python 3.9) and the problem that I'm encountering is that when I "pip install" scons, I only get a bunch of "exe's" under Scripts and no *-script.py file where I can replace the shebang line.

At the beginning I thought, ok, maybe now I can simply change the Python directory without having to worry about shebang lines, but I foound the same issue, scons.exe will not run if I move the python installation folder.

I spend 4 hours with this issue, googling it and trying different things and anything work.

How can I make pip install to create *-script.pu files? Or how can I make a Python installation that does not depend on the absolute path where Python was installed?
Reply


Messages In This Thread
Python broken if moved to a different folder - by ecastrotns - Oct-26-2020, 10:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question How to add Python folder in Windows Registry ? Touktouk 1 276 Feb-20-2024, 01:04 PM
Last Post: DeaD_EyE
  Compare folder A and subfolder B and display files that are in folder A but not in su Melcu54 3 560 Jan-05-2024, 05:16 PM
Last Post: Pedroski55
  python gzip all files from a folder mg24 3 4,033 Oct-28-2022, 03:59 PM
Last Post: mg24
  Make a python folder .exe Extra 0 1,032 Jun-10-2022, 01:20 AM
Last Post: Extra
  Why is copying and pasting a block now broken? WagmoreBarkless 2 1,398 May-05-2022, 05:01 AM
Last Post: WagmoreBarkless
  Why is copying and pasting a block now broken? WagmoreBarkless 1 1,237 May-04-2022, 11:40 PM
Last Post: Larz60+
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,508 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  BrokenPipeError: [Errno 32] Broken pipe throwaway34 6 9,341 May-06-2021, 05:39 AM
Last Post: throwaway34
  Move file from one folder to another folder with timestamp added end of file shantanu97 0 2,483 Mar-22-2021, 10:59 AM
Last Post: shantanu97
  Python Cut/Copy paste file from folder to another folder rdDrp 4 5,070 Aug-19-2020, 12:40 PM
Last Post: rdDrp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020