Python Forum
Python 2.7.14 install on Windows missing Scripts directory and pip #bug
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python 2.7.14 install on Windows missing Scripts directory and pip #bug
#1
I have tried to install Python 2.7.14 x64 on Windows 10 with the executable installer (.msi).

I installed in C:\Program Files\Python27.
I explicitly did not install in the default location C:\Python27 because this is less secure and defies Windows practices and guidelines.
During setup I selected to add Python to the PATH environment variable.

When installing in C:\Program Files\Python27, the Scripts directory is not installed which includes pip.exe and also the libraries in the Lib directory do not get precompiled (no .pyc files).

Installing in C:\Python27 does not have these issues, but that is not where I want Python to be installed.

This appears to be a bug in the Python 2.7.14 installer (I have not tried any older versions but expect these to give the same issues).
Reply
#2
Why are you installing any version of Python 2, rather than the latest version of Python 3?  If you are that concerned about security, you should install it for yourself only and in the "C:\Users\yourname" directory, though I will tell you, you will tire quickly of having to type the entire directory chain. Unless you are using a shared computer, security is really not a concern. If you are on a shared computer, you can always create a projects directory under your user directory and keep all your scripts there.

As a side note, the "Program Files" directory is for 64 bit programs, and the "Program Files (x86)" are meant for 32 bit programs. Seems silly to me since Windows 10 knows the difference and really doesn't rely on the location. For a full explanation see here: https://www.howtogeek.com/129178/why-doe...86-folder/
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
Quote:Unless you are using a shared computer, security is really not a concern.
Oh really?! I cannot agree less with you here.

It should not come as a surprise that several applications do require and support Python 2.7 only. So this is not a matter of choice but strictly a requirement.

I am well aware of Windows, Program Files directories, x86 and x64 etc. That is why I installed the Python 64-bit version in C:\Program Files\Python27 and not in C:\Program Files (x86)\Python27.
Reply
#4
(Dec-15-2017, 03:57 PM)bluejedi Wrote: Oh really?!

Yes really. In order for you to create a directory under the main "C:\" you need admin privileges (unless you've altered the default settings) and if someone other than you has admin privileges, Python should be the least of your worries.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#5
I tried the following:

Install Python 2.7 x64 to C:\Python27 first,
then make a copy of the Scripts directory,
uninstall Python 2.7 again,
then install it to C:\Program Files\Python 2.7,
then copy the saved Scripts directory to C:\Program Files\Python27\Scripts
The installer had not installed it but it did put the Scripts directory in the PATH environment variable (so this definitely seems a bug).

When I then tried to run pip.exe (or pip2.exe) it failed with the following error message:
Fatal error in launcher: Unable to create process using '"'

It does not make a difference if I try to run this from a standard command prompt or from a command prompt that was started as Administrator.

Can this error be caused by the fact that the libraries were not pre-compiled during install?

(Dec-15-2017, 04:05 PM)sparkz_alot Wrote: In order for you to create a directory under the main "C:\" you need admin privileges (unless you've altered the default settings) and if someone other than you has admin privileges, Python should be the least of your worries.

There any many more security threads than your example. That is why Windows uses UAE to prevent rogue code from running with Administrator privileges. That is why programs are installed in C:\Program Files and C:\Program Files (x86) and not in the root.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  embedded Python scripts - is it worthwhile Skaperen 3 510 Feb-21-2024, 01:25 AM
Last Post: Skaperen
  images and pixels in typical Python scripts Skaperen 0 1,194 Oct-14-2021, 12:29 AM
Last Post: Skaperen
  Creating Python scripts in Visual Studio Code Sanjish 4 2,534 Dec-22-2020, 12:32 PM
Last Post: snippsat
  suid scripts in python? Skaperen 0 2,113 Sep-29-2019, 10:28 PM
Last Post: Skaperen
  Can copyright be applied python scripts? tim777 3 4,791 Sep-04-2019, 12:20 PM
Last Post: DeaD_EyE
  Finding Scripts for Python Johnny1998 1 2,168 Jul-31-2019, 08:07 PM
Last Post: Yoriz
  windows install py.exe fulkgl 1 3,977 Sep-16-2018, 09:10 PM
Last Post: snippsat
  embedding Python script in shell scripts Skaperen 5 8,151 Mar-23-2018, 01:07 AM
Last Post: Skaperen
  [PyPa] Problems with Install PIP on Windows ! JamieVanCadsand 7 9,655 Sep-25-2017, 10:37 AM
Last Post: JamieVanCadsand
  Can I install Python 3.6.2 on Windows 10 for All Users? DAWO 1 29,800 Sep-15-2017, 01:31 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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