Reputation: 500
I would like to use Pycharm to write some data science code and I am using Visual Studio Code and run it from terminal. But I would like to know if I could do it on Pycharm? I could not find some modules such as cluster and pylab on Pycharm? Anyone knows how I could import these modules into Pycharm?
Upvotes: 2
Views: 6558
Reputation: 3744
executing
pip install cluster
for cluster and
pip install matplotlib
for pylab in the pycharm terminal which is located at the bottom of the screen is another method for installing those two packages. (if you want to import pylab, use from matplotlib import pylab).
Additionally you can install any package in PyPI into pycharm virtual environment using this.
Upvotes: 3
Reputation: 5759
Go to the Preferences Tab -> Project Interpreter, there's a + symbol that allows you to view and download packages. From there you should be able to find cluster and pylab and install them to PyCharm's interpreter. After that you can import them and run them in your scripts.
Alternatively, you may switch the project's interpreter to an interpreter that has the packages installed already. This can be done from that same menu.
Upvotes: 1
Reputation: 3315
Try using the built-in Scientific Mode feature in Pycharm. You can activate it by selecting View > Scientific Mode
.
Upvotes: 0