pip: Error installing package with executable

Environment

  • pip version: 20.2.4
  • Python version: 3.9.0
  • OS: Windows 10 Build 20236

Description Attempting to install pip-run fails.

Expected behavior The installation of this package should succeed or a more informative error message should be provided.

How to Reproduce I’ve installed Python with chocolatey (choco install python), upgraded pip with py -m pip install -U pip, then:

$ py -m pip install pip-run
Collecting pip-run
  Using cached pip_run-8.2.0-py3-none-any.whl (14 kB)
Requirement already satisfied: pip>=19.3 in c:\python39\lib\site-packages (from pip-run) (20.2.4)
Installing collected packages: pip-run
  WARNING: Failed to write executable - trying to use .deleteme logic
ERROR: Could not install packages due to an EnvironmentError: [WinError 2] The system cannot find the file specified: 'C:\\Python39\\Scripts\\pip-run.exe' -> 'C:\\Python3
9\\Scripts\\pip-run.exe.deleteme'

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 16
  • Comments: 29 (4 by maintainers)

Most upvoted comments

The issue appears to be a permissions one. The error only occurs when running not as Administrator.

You can add your User in C:\Python39 folder security pannel with full access permission to solve this problem. @jaraco

I just right clicked on the python folder, went to properties and allowed the permission via security tab

בתאריך יום ג׳, 7 בדצמ׳ 2021, 18:05, מאת Cat4209 @.***>:

You can add your User in C:\Python39 folder security pannel with full access permission to solve this problem. @jaraco https://github.com/jaraco

Thanks, solved for me!

How did you do this ? Should I create a folder ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pypa/pip/issues/9023#issuecomment-988065091, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARLYSIYSA4JGKNBHYIGU4W3UPYWD3ANCNFSM4SY5KWDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

pip install pip-run --user this worked for me

You can add your User in C:\Python39 folder security pannel with full access permission to solve this problem. @jaraco

I navigated to C:/Python311 and right clicked on the folder itself

  • Properties
    • Security tab up top
      • Edit permissions
        • Select User, change permissions, apply cahnges

pip install pip-run --user worked for me too

I assume you installed Python as admin as well (iirc chocolatey requires running as admin)? If so, yes this is a permission issue, pip cannot remove files (before installing the new version). I recall pip has some error handling around this (it should show a friendly message when it hits issues like this), so th main question here is why that handling did not kick in for you.

You can add your User in C:\Python39 folder security pannel with full access permission to solve this problem. @jaraco

Thanks, solved for me!

How did you do this ? Should I create a folder ?