0

I have recently started using PyCharm to write my python code. In the past, I have used Jupyter Notebook more.

I thought that the packages I have installed in Jupyter would work in PyCharm, but this is not the case. I keep getting "module not found" errors in Pycharm.

How do I configure Pycharm so that all the packages I have installed in Jupyter are usable PyCharm as well? The only way I can think of is to reinstall each module separately in Pycharm, but there are so many that I have installed in Jupyter that it would not be practical.

Vishwa
  • 55
  • 1
  • 5
  • 1
    If you used a virtual environment for your jupyter, then you can reuse it in your PyCharm project: Under `file -> settings -> -> Python interpreter` you can select an existing virtual environment to be used as the project's one. – Nechoj Mar 28 '22 at 19:28
  • How would I get Jupyter to tell me what the file path to the virtual environment is? Is there some sort of print statement? I ask because when I tried checking the interpreter, I see multiple different versions of Python. I don't know which one I have all my packages downloaded to. – Vishwa Mar 28 '22 at 23:51
  • 1
    I think it depends which Python distribution you are using. Here is a tutorial for various possibilities: . If you are on the command line and inside the venv, the command to list the venv would be `jupyter kernelspec list`. Note that the venv is just a folder with a python executable and the downloaded packages. – Nechoj Mar 29 '22 at 06:25
  • Hey, as an update to this, I was able to find the virtual environment. – Vishwa Apr 01 '22 at 17:53
  • I can now use the packages. – Vishwa Apr 01 '22 at 17:53
  • 1
    Simple: InPycharm file -> settings -> -> Python interpreter add a new interpreter and choose the python executable inside the venv. Then, all packages inside that venv are added to your projekt automatically. – Nechoj Apr 01 '22 at 20:22

0 Answers0