question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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.pys. 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:closed
  • Created 3 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
PetterScommented, Oct 6, 2020

It isn’t really documented but for anyone finding this issue and wondering how to do it, here is a command:

poetry config experimental.new-installer false --local

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.

1reaction
ponascommented, Oct 6, 2020

@abn Your latest commit solves my issue. Thanks for looking into this! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Poetry has officially fixed / permanently included pip install -e
Installing a Poetry project in editable mode via pip wasn't possible for a long time, because pip doesn't know how to do this....
Read more >
History | Poetry - Python dependency management and ...
Fix an issue where a package from the wrong source was installed for a multiple-constraints dependency with different sources (#6747).
Read more >
poetry can't find version of dependency even though it exists
1. poetry seems to consistently botch the upgrade of a venv when you modify the python versions. According to finswimmer, the upgrade should ......
Read more >
How to Publish an Open-Source Python Package to PyPI
First, though, you'll learn about editable installs. This is a way of using pip to install your package locally in a way that...
Read more >
Conda Pip and All That - Washington State University
Use pip install --extra-index-url <index.html> to allow pip to resolve dependencies against your source code. Poetry (Trial) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found