Skip to content

Windows 10 3.6.1 install disallows pip installs of packages #74716

Description

@ThomasShinnick
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']

Activity

  1. ThomasShinnick commented on May 31, 2017

    ThomasShinnickmannequin
    MannequinAuthor

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

  2. eryksun commented on May 31, 2017

    @eryksun
    Contributor

    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.

  3. zooba commented on May 31, 2017

    @zooba
    Member

    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.

  4. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions