pythonpycharmpython-poetry

PyCharm project cannot add poetry interpreter


I have tried to build a new PyCharm project by poetry environment, enter image description here while setting up it showed enter image description here

and cannot setup the interpreter. Have anyone got the similar problem before and know how to solve this error?

Update
I have upgraded the PyCharm version to PyCharm Professional 2022.1.1 and the problem still remain.


Solution

  • Alright, I have fixed this problem.

    Below is my debug steps, hope it can help those who are struggling in the same situation:

    1. Posting a support report to PyCharm team with no responce
    2. Searching for a lot of posts from communities
    3. Creating a poetry project by terminal
    4. Inside the project directory, I tried poetry env info and it showed that the local virtualenv is NA
    5. Trying to create one by poetry env use $(which python), yet it returned Skipping virtualenv creation, as specified in config file and this answer gave me a hint.
    6. Typing poetry config --list and it showed that virtualenvs.create = false
    7. Trying to enable the virtualenv creation by the command poetry config virtualenvs.create true
    8. Restarted the PyCharm IDE and tried to add the interpreter again and it WORKED!!

    I am not sure if the command poetry config virtualenvs.create true is permant or not.