1

I have some troubles setting up PyCharm.

I have my projects set up this way (opened Python folder in PyCharm):

    Python\
        API\
            API_Project_1\
            API_Project_2\
            …

And so on. Even tho in BOTH API_projects there are virtualenvs with the properly installed modules, whenever i import something such as:

import uvicorn

PyCharm underlines it in red saying "No module named 'uvicorn'"

Why is that?

EDIT AFTER FIRST COMMENT: This has nothing to do with VSCode or VSCode projects. My question is: How to import ALL my projects (divided as i shown above in that folder structure) into PyCharm and have it recognize them all as different projects.

And when i open a file of a project and execute it, all works fine cause i properly imported every module and created a virtualenv, BUT PyCharm doesn't recognize it properly, in fact shows me errors like "Unresolved reference 'fastapi'" as an example.

EDIT 2: Modified post to better show my problem

A.Fish
  • 143
  • 11
  • You question is confusing. If you're asking how to open a VSCode project in PyCharm you need to [open a new project](https://www.jetbrains.com/help/pycharm/open-projects.html) using the GUI as normal. There's no way around that because PyCharm has to [create its project configuration files](https://stackoverflow.com/q/66043675). If on the other hand the `.idea` folder is already created and your project files are already installed in the venv the PyCharm will auto-detect them as being installed. – bad_coder Nov 22 '21 at 22:26
  • Does this answer your question? [PyCharm error: 'No Module' when trying to import own module (python script)](https://stackoverflow.com/questions/28705029/pycharm-error-no-module-when-trying-to-import-own-module-python-script) – bad_coder Nov 22 '21 at 22:28
  • @bad_coder No, sorry if i explained myself bad. I'm not trying to open a VSC project, ignore that part. All i said is that i'm coming into PyCharm from VSCode, that's all. Just look my folder structure now. I have MULTIPLE projects divided in those folders, and i would like to add them all to PyCharm without getting errors, how can i do? – A.Fish Nov 23 '21 at 07:52
  • If that's the case the links in the previous comments have everything you need. – bad_coder Nov 23 '21 at 09:23
  • @bad_coder doesn't that fix only imports of my own modules? cause i have problems on ANY module, even fastapi ones (so modules i install with pip inside venv, not modules from my other folders) – A.Fish Nov 23 '21 at 11:14

0 Answers0