RussAbbott
RussAbbott

Reputation: 2738

Is there a way to have pycharm always install some modules?

For reinforcement learning, my code typically starts with these lines

import gym
import numpy as np
import matplotlib.pylab as plt

Yet every new project says that these modules are not available. I have to install them via File > Settings > Project Interpreter > +

Is there a way to set up PyCharm so that they are installed for all projects and I can just import them as needed?

It turns out that the three modules are listed in External Libraries > Python 3.5 > Lib > site_packages. Yet I still can't import them into a new project even though they are listed in site_packages in that project. Why not?

Thanks.

Upvotes: 0

Views: 69

Answers (1)

Nipun Thennakoon
Nipun Thennakoon

Reputation: 3744

You can tick the inherit global site packages option when creating a new project. Then you'll be able to import all the libraries you need to the pycharm virtual environment, provided they have been installed in your computer.

enter image description here

Upvotes: 2

Related Questions