Editable installs sometimes cannot be imported (poetry 1.1.0)
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: Fedora 32 (also reproduced with Docker base image python:3-slim)
-
Poetry version: 1.1.1
-
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/ponas/f02c8228a4e366bc255f4f4d1dd32cec
Issue
This issue first appears with Poetry 1.1.0. I cannot reproduce this issue on 1.0.9.
When Poetry installs the two packages from git, no exceptions occur, but sometimes one of them cannot be imported in the resulting environment:
$ poetry install
[snip]
• Installing cerebrum-client (1.9.2 95a1839)
• Installing tofh (2.0.6 8f9dac0)
$ poetry run python -c 'import tofh'
$ poetry run python -c 'import cerebrum_client'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'cerebrum_client'
I was unable to reproduce this by installing packages such as Django, requests and flask via git, making me think this may be related to something in our setup.py
s. Might not be a bug in poetry, but this behavior is new 😃
Workaround
Current workaround is to disable the new installer in favour of the old one. (https://github.com/python-poetry/poetry/issues/3086#issuecomment-703692203)
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (8 by maintainers)
It isn’t really documented but for anyone finding this issue and wondering how to do it, here is a command:
Several people are having trouble with parallel installation. I would not say that the “only real issue” is the develop install since the uninstalls crashes as well.
Sure, of course it would be nice to mitigate or fix, but 1.1 is a stable version which people are using for real things. Stability should come before features for a tool like this IMHO.
But you are right, disabling
experimental.new-installer
should hopefully fix most things.EDIT: This was also posted higher up in the thread, which I did not see.
@abn Your latest commit solves my issue. Thanks for looking into this! 😃