Skip to content

PyCharm displays module imports as erroneous even though they work fine #98

Answered by DavidVujic
betterthanever2 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

I think it might be an issue with how PyCharm is adding the virtual environment to a repo.

Make sure that you have a local virtual environment configuration, by adding a poetry.toml to the top folder with the content:

[virtualenvs]
path = ".venv"
in-project = true

Run poetry install in a shell.

This will install the dependencies, and make the environment aware of the bases and components folders. PyCharm will ask about what interpreter to use when opening a Python file. Make sure to choose the local one in the .venv folder.

Everything should now be set up correctly for PyCharm!

The docs have also been updated with this information. Thank you for posting this here @betterthanever2!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@betterthanever2
Comment options

Answer selected by DavidVujic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants