poetry: Pip-installed Poetry encountering EnvironmentError "Permission denied" on Windows when upgrading cffi

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Windows 10

  • Poetry version: 1.0.10

Issue

I’ve just encountered this problem while running poetry update, which upgraded the cffi package. Using pip 20.2.3 on python 3.9b5 on Windows 10, while using poetry 1.0.10.

PS C:\pas\projects\xxxx\ci> .\venv-windows\Scripts\python.exe -m poetry update
Skipping virtualenv creation, as specified in config file.
Updating dependencies
Resolving dependencies...

Writing lock file


Package operations: 0 installs, 5 updates, 0 removals

  - Updating attrs (19.3.0 -> 20.2.0)
  - Updating cffi (1.14.0 -> 1.14.2)

[EnvCommandError]
Command ['C:\\pas\\projects\\xxxx\\ci\\venv-windows\\Scripts\\python.exe', '-m', 'pip', 'install', '--no-deps', '-U', 'cffi==1.14.2'] errored with the following return code 1, and output:
Collecting cffi==1.14.2
  Downloading cffi-1.14.2.tar.gz (470 kB)
Using legacy 'setup.py install' for cffi, since package 'wheel' is not installed.
Installing collected packages: cffi
  Attempting uninstall: cffi
    Found existing installation: cffi 1.14.0
    Uninstalling cffi-1.14.0:
      Successfully uninstalled cffi-1.14.0
    Running setup.py install for cffi: started
    Running setup.py install for cffi: finished with status 'done'
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Permission denied: 'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-uninstall-8rjju1cu\\_cffi_backend.cp39-win_amd64.pyd'

Of course it’s not the best practice to install poetry via pip. Maybe providing a command line argument to ignore these errors might be worth it?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (6 by maintainers)

Most upvoted comments

@sinoroc

Are you sure the issue is reproducible in a fresh environment?

Yes, 100% sure. Actually the above log was from a fresh environment.

Exact same issue with poetry, cffi and windows, I try to create a minimum reproduction

Hi @SergeyHein, I am facing the same issue on my build server. If you are on local machine, you can delete charset-normalizer safely, and it will work. I am not sure what I can do on the build server.

FYI: I’ve encountered this problem many times over various conda/python/pip/poetry -versions and it’s still a thing! Is there a known issue somewhere?
@Toxe Some weird permissions issue is plausible.

Latest setup with this error:

  • Windows 10H2
  • conda 4.10.3
  • python 3.9.13
  • poetry 1.1.14
  • pip 22.2.2

Solution:

  • manually delete folder “<conda-venv>/Lib/site-packages/~egex”

@Korijn what happens when you do the following? (My windows is a bit rusty!)

python3.6 -m venv .venv
.venv\Scripts\python.exe -m pip install -U pip