Python Forum
Python 2.7.14 install on Windows missing Scripts directory and pip #bug - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: Python 2.7.14 install on Windows missing Scripts directory and pip #bug (/thread-6958.html)



Python 2.7.14 install on Windows missing Scripts directory and pip #bug - bluejedi - Dec-15-2017

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).


RE: Python 2.7.14 install on Windows missing Scripts directory and pip #bug - sparkz_alot - Dec-15-2017

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-does-64-bit-windows-need-a-separate-program-files-x86-folder/


RE: Python 2.7.14 install on Windows missing Scripts directory and pip #bug - bluejedi - Dec-15-2017

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.


RE: Python 2.7.14 install on Windows missing Scripts directory and pip #bug - sparkz_alot - Dec-15-2017

(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.


RE: Python 2.7.14 install on Windows missing Scripts directory and pip #bug - bluejedi - Dec-15-2017

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.