Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 10 3.6.1 install disallows pip installs of packages #74716

Closed
ThomasShinnick mannequin opened this issue May 31, 2017 · 3 comments
Closed

Windows 10 3.6.1 install disallows pip installs of packages #74716

ThomasShinnick mannequin opened this issue May 31, 2017 · 3 comments
Labels
OS-windows type-bug An unexpected behavior, bug, or error

Comments

@ThomasShinnick
Copy link
Mannequin

ThomasShinnick mannequin commented May 31, 2017

BPO 30531
Nosy @pfmoore, @tjguk, @zware, @eryksun, @zooba

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2017-05-31.23:46:22.846>
created_at = <Date 2017-05-31.21:29:51.773>
labels = ['type-bug', 'invalid', 'OS-windows']
title = 'Windows 10 3.6.1 install disallows pip installs of packages'
updated_at = <Date 2017-05-31.23:47:32.532>
user = 'https://bugs.python.org/ThomasShinnick'

bugs.python.org fields:

activity = <Date 2017-05-31.23:47:32.532>
actor = 'steve.dower'
assignee = 'none'
closed = True
closed_date = <Date 2017-05-31.23:46:22.846>
closer = 'eryksun'
components = ['Windows']
creation = <Date 2017-05-31.21:29:51.773>
creator = 'Thomas Shinnick'
dependencies = []
files = []
hgrepos = []
issue_num = 30531
keywords = []
message_count = 3.0
messages = ['294872', '294884', '294885']
nosy_count = 6.0
nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'eryksun', 'steve.dower', 'Thomas Shinnick']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue30531'
versions = ['Python 3.6']

@ThomasShinnick
Copy link
Mannequin Author

ThomasShinnick mannequin commented May 31, 2017

Installed using python-3.6.1-amd64.exe then tried to pip install a package. Repeatedly had to manually intervene to open up permissions on python install subdirs, after getting these errors one at a time from pip:
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python 3.6\\Lib\\site-packages\\fontTools'
PermissionError: [Errno 13] Permission denied: 'c:\\program files\\python 3.6\\Scripts\\pylupdate5.exe'
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python 3.6\\share'
Gave up and set "full control" on \python 3.6\ dir and contents.

It seems permissions default to "read-only" subdirs which makes pip installs impossible. Install and pip used under same userid and same session. I thought I'd clicked yes to any question "install for all users".

@ThomasShinnick ThomasShinnick mannequin added expert-installation type-bug An unexpected behavior, bug, or error labels May 31, 2017
@eryksun
Copy link
Contributor

eryksun commented May 31, 2017

You installed Python for all users, which defaults to installing in %ProgramFiles% or %ProgramFiles(x86)%. Python's installation directory inherits the security of its parent directory, which in this case grants full control only to SYSTEM, TrustedInstaller, and Administrators. Standard users are granted only read and execute access. Thus if you're logged on as a standard user or UAC-restricted administrator, adding and removing packages requires running pip from an elevated command prompt (cmd.exe) that's "[r]un as administrator".

A per-user installation, on the other hand, defaults to installing in a subdirectory of the user's "%LocalAppData%\Programs" directory, for which the user should have full control.

In either case you can change the default installation directory. In general, I wouldn't recommend installing for all users to an untrusted location, but you're of course free to do that if you want.

@zooba
Copy link
Member

zooba commented May 31, 2017

You can try installing with "--user" to install to a per-user directory, start running pip from an administrative command/PowerShell prompt, or use the venv module to create a virtual environment.

Alternatively, if you select the default installation options you will get one that you can modify freely, but because it's in your user directory nobody else on the machine can use it.

Installing to Program Files is supposed to be read only. You're welcome to open it up, just be aware that it is a security risk to do so.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants