Skip to content
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

Error Creating New Poetry Environment #6551

Closed
3 tasks done
Arthur-Huan opened this issue Sep 17, 2022 · 7 comments
Closed
3 tasks done

Error Creating New Poetry Environment #6551

Arthur-Huan opened this issue Sep 17, 2022 · 7 comments
Labels
kind/bug Something isn't working as expected status/external-issue Issue is caused by external project (platform, dep, etc)

Comments

@Arthur-Huan
Copy link

  • 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: <Ubuntu 22.04.1 LTS>
  • Poetry version: <1.2.1>
  • Link of a Gist with the contents of your pyproject.toml file: <!-- Gist Link Here -->

Issue

This is my first time using Poetry. When using PyCharm to configure a poetry interpreter, it says

Directory /home/arthur/.cache/pypoetry/virtualenvs/pyproject-bQEURbrH-py3.10/bin/python not found

When I try again to configure the interpreting using the environment that was created, it says Error Running Poetry. The command output is:

Recreating virtualenv pyproject-bQEURbrH-py3.10 in /home/arthur/.cache/pypoetry/virtualenvs/pyproject-bQEURbrH-py3.10

The virtual environment found in /home/arthur/.cache/pypoetry/virtualenvs/pyproject-bQEURbrH-py3.10 seems to be broken.

Invalid PEP 440 version: '1.1build1'

I've seen the same error from the PyCharm forums, and applied the fix

sudo apt install python3-pip pip3 install virtualenv

Which didn't change anything. I've also tried installing python3-venv too.

@Arthur-Huan Arthur-Huan added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 17, 2022
@Secrus
Copy link
Member

Secrus commented Sep 17, 2022

could you try it from CLI? It should work fine. What you are describing seems to be a Pycharm bug, not a Poetry one.

@Arthur-Huan
Copy link
Author

could you try it from CLI? It should work fine. What you are describing seems to be a Pycharm bug, not a Poetry one.

I did try creating an environment from the CLI, however the project doesn't have an interpreter, nor does it have a poetry.lock file.

@krageon
Copy link

krageon commented Oct 4, 2022

This consistently breaks because of ubuntu packaging: https://bugs.launchpad.net/ubuntu/+source/python-debian/+bug/1926870

This is shit, but it would be good if I could at least work around dist-packages having things poetry can't work with. As it stands I don't think I can solve it at all (e.g. I can't tell it to ignore those packages that don't work).

@neersighted neersighted added status/external-issue Issue is caused by external project (platform, dep, etc) and removed status/triage This issue needs to be triaged labels Oct 4, 2022
@neersighted
Copy link
Member

I think there are two things going on here -- Pycharm is trying to create a Poetry environment in an odd way that is affected by system packages, and failing.

@krageon, I suspect that instead you are hitting #6623, especially if you have virtualenvs.create false or virtualenvs.opts.system-site-packages true set. In either of those cases this is not currently considered a Poetry bug, though I do have some ideas an interested contributor could pursue to try and avoid the pitfalls I originally described in that discussion.

In any case, barring a reproduction that doesn't involve PyCharm, I'm closing this for now -- if you can reproduce this occurring with a simple poetry install in a clean environment with default options set (e.g. in a Ubuntu 22.04 container), please open a new issue to track the PyCharm-free reproduction.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2022
@krageon
Copy link

krageon commented Oct 4, 2022

I have neither of those things set. I'll attempt to create a docker container that has this issue so you can see what goes wrong.

@krageon
Copy link

krageon commented Oct 4, 2022

I see it is this #4597 (comment) this issue. The workaround there works as well.

Copy link

github-actions bot commented Mar 1, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/external-issue Issue is caused by external project (platform, dep, etc)
Projects
None yet
Development

No branches or pull requests

4 participants