-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFoundError: No module named 'platformdirs'
when doing poetry install --dev
#4493
Comments
Hello @stianlagstad, there are multiple reasons for this: First, never install poetry into the environment that should be managed by poetry. There's a good chance that otherwise dependencies needed by poetry itself gets removed or updated/downgrade when installing a project by poetry. Instead use the official installer or pipx. Second, at the moment poetry removes dev-dependencies (and the dependecies of these dependencies) it finds some in the current environment, when running So here is my recommendation:
fin swimmer |
Thanks for explaining (and for the fast answer), @finswimmer ! |
Note that with poetry 1.1.9 (due to #4507 likely) the behavior when installing poetry in its own virtualenv (or via pipx) changed the location where packages are being installed (into |
(same fix as Mon Aug 1 fix applied here to default dockerfile)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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: python:3.9.6-buster
Poetry version: 1.1.8
Link of a Gist with the contents of your pyproject.toml file: Repo with issue reproduced: https://github.com/stianlagstad/reproduce-poetry-virtualenv-issue
Issue
First running
poetry install --no-dev
and then runningpoetry install
leads to the errorModuleNotFoundError: No module named 'platformdirs'
. I've setup a repository that reproduces the issue: https://github.com/stianlagstad/reproduce-poetry-virtualenv-issue.Dockerfile:
Our actual Dockerfile is using multi stage builds, and in our final image (our testrunner) we want the dev dependencies installed. That's why we first do
poetry install
, and then later topoetry install --dev
.Error output:
Am I doing anything wrong? Is this expected?
The text was updated successfully, but these errors were encountered: