Poetry: Fixing permission error when upgrading dulwich
All notes in this series:
- Poetry: Fixing dubious ownership error
- Poetry: build.py example
- Poetry: Automatically generate package version from git commit
- Poetry: Fix warning about sources
- Poetry: Running Black and isort with pre-commit hooks
- Poetry: Fixing permission error when upgrading dulwich
- NiceGUI with Click, Poetry, auto-reload and classes
- Poetry: Offline installation of packages
- Run Poetry command as systemd service
- GitLab CI and poetry-dynamic-versioning
- Poetry: install alpha builds
- Upgrade version of pkginfo used by Poetry
When attempting to upgrade from Poetry v1.5.1 to v1.6.1 by running poetry self update
I got the following error:
It appeared to be stuck trying to upgrade dulwich. Subsequent attempts to fix this by doing poetry self update
then hit this error:
Presumably the dulwich installation got broken somehow? My initial attempts to fix this by re-installing Poetry still led to the same error, because the virtual environment persists between re-installs.
The fix §
I fixed this error with the following manual steps:
- Delete this directory, which was causing the
PermissionError
1:C:\Users\<user>\AppData\Roaming\pypoetry\venv\Lib\site-packages\~ulwich
. - Find the virtual env
activate
script at:C:\Users\<user>\AppData\Roaming\pypoetry\venv\Scripts
. - Run
./activate
to enter the Poetry virtual env. - Run
pip install dulwich==0.21.6
to install dulwich v0.21.6 in the Poetry virtual env.
Then I was able to run poetry self update
successfully.
I did not need admin rights to delete this, so I’m not sure why Poetry was consistently getting
PermissionError
. ↩︎