`poetry self update --preview` leads to `[WinError 5] Access is denied: 'py3.7\\msgpack\\_cmsgpack.cp37-win_amd64.pyd'`
See original GitHub issue- 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 pro, version 1909
- Poetry version: 1.0.9
- Link of a Gist with the contents of your pyproject.toml file: no project specific probelm
Issue
I use powershell and pyenv
on windows with python 3.7. Python 3.7.5 is the newest version according to pyenv install -l
Updating to the latest preview does not work as expected, I assumed poetry self update --preview
would work.
But see the log below, I can reproduce it every time with the same error. Installing/using poetry 1.0.9 works without issues.
I guess it is similar to #1032 as shutil.py
is involved in both problems, but the error is different.
Steps to reproduce
- install poetry with
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
- try to update with
poetry self update --preview
Afterwards the poetry installation is corrupted and does not work anymore
Workaround powershell command
- delete the
.poetry
folder manually (located in user home directory) (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python - --preview
Log that shows error
PS C:\Users\jahna> (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
%USERPROFILE%\.poetry\bin
This path will then be added to your `PATH` environment variable by
modifying the `HKEY_CURRENT_USER/Environment/PATH` registry key.
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing version: 1.0.9
- Downloading poetry-1.0.9-win32.tar.gz (10.72MB)
Poetry (1.0.9) is installed now. Great!
To get started you need Poetry's bin directory (%USERPROFILE%\.poetry\bin) in your `PATH`
environment variable. Future applications will automatically have the
correct environment, but you may need to restart your current shell.
PS C:\Users\jahna> poetry self update --preview -vvv
Updating to 1.1.0a3
[PermissionError]
[WinError 5] Access is denied: 'C:\\Users\\jahna\\.poetry\\lib\\poetry\\_vendor\\py3.7\\msgpack\\_cmsgpack.cp37-win_amd64.pyd'
Traceback (most recent call last):
File "C:\Users\jahna\.poetry\lib\poetry\_vendor\py3.7\clikit\console_application.py", line 131, in run
File "C:\Users\jahna\.poetry\lib\poetry\_vendor\py3.7\clikit\api\command\command.py", line 120, in handle
File "C:\Users\jahna\.poetry\lib\poetry\_vendor\py3.7\clikit\api\command\command.py", line 171, in _do_handle
File "C:\Users\jahna\.poetry\lib\poetry\_vendor\py3.7\cleo\commands\command.py", line 92, in wrap_handle
File "C:\Users\jahna\.poetry\lib\poetry\console\commands\self\update.py", line 134, in handle
File "C:\Users\jahna\.poetry\lib\poetry\console\commands\self\update.py", line 146, in update
File "C:\Users\jahna\.pyenv\pyenv-win\versions\3.7.5-amd64\lib\shutil.py", line 516, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\jahna\.pyenv\pyenv-win\versions\3.7.5-amd64\lib\shutil.py", line 395, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\jahna\.pyenv\pyenv-win\versions\3.7.5-amd64\lib\shutil.py", line 395, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\jahna\.pyenv\pyenv-win\versions\3.7.5-amd64\lib\shutil.py", line 395, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
[Previous line repeated 1 more time]
File "C:\Users\jahna\.pyenv\pyenv-win\versions\3.7.5-amd64\lib\shutil.py", line 400, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\jahna\.pyenv\pyenv-win\versions\3.7.5-amd64\lib\shutil.py", line 398, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\jahna\\.poetry\\lib\\poetry\\_vendor\\py3.7\\msgpack\\_cmsgpack.cp37-win_amd64.pyd'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\jahna\.poetry\bin\poetry", line 18, in <module>
main()
File "C:\Users\jahna\.poetry\lib\poetry\console\__init__.py", line 5, in main
File "C:\Users\jahna\.poetry\lib\poetry\_vendor\py3.7\clikit\console_application.py", line 139, in run
File "C:\Users\jahna\.poetry\lib\poetry\_vendor\py3.7\clikit\ui\components\exception_trace.py", line 58, in render
File "C:\Users\jahna\.poetry\lib\poetry\_vendor\py3.7\clikit\ui\components\exception_trace.py", line 63, in _render_traceback
File "C:\Users\jahna\.poetry\lib\poetry\_vendor\py3.7\clikit\ui\components\exception_trace.py", line 75, in _format_traceback_frame
TypeError: 'NoneType' object is not subscriptable
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Could not install packages due to an EnvironmentError ...
When I run pip install pip --upgrade pip in a CMD with administrator rights in order to install in a virtualenv, I get...
Read more >Introduction | Documentation | Poetry - Python dependency ...
Introduction Poetry is a tool for dependency management and packaging in Python. ... your project depends on and it will manage (install/update) them...
Read more >OSError: [WinError 5] Access is denied when upgrading from
I am trying to upgrade from QATrack+ v0.2.9 to v3.1.0 on Windows server ... ERROR: Could not install packages due to an OSError:...
Read more >Poetry update has access denied - Anycodings.com
Poetry update has access denied I'm using poetry inside a conda environmentm ... due to an EnvironmentError: [WinError 5] Access is denied:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Still having the same issue in 2021, had to uninstall and use the new install script to get the preview working:
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python - --preview
Not finding any definitive solution online and I followed the exact install steps, not sure how to fix it without a full re-install.
I’m having the same problem, even with the latest 1.1.0B2 version, I tested powershell, cmd and elevated cmd with the same error.