I'm trying to import NumPy on PyCharm.
Using the PyCharm terminal and Miniconda I've launched the command:
conda install numpy
And this was the output:
Fetching package metadata: ....
Solving package specifications: ....................
# All requested packages already installed.
# packages in environment at C:\Users\...\Miniconda3:
#
numpy 1.10.4 py35_0
So I run my project but the terminal said:
ImportError: No module named 'numpy'
On my project bar I can see two different folders, the one with my project and another one with the external libraries.
Under External libraries
>
Extendend definitions
there is a NumPy folder so I guess that the installation goes well.
PyCharm can do both. Type the name of the package and hit Alt-Enter , then choose Install and Import package . PyCharm will do both: you'll see a notification during the installation, then the import will be generated in the right way, according to your project styles.
Go to
if it doesnt work this can help you:
https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html
In PyCharm go to
C:\Miniconda3\envs\my_env\python.exe
, where my_env is the environment you want to useAlternatively, in step 3 use C:\Miniconda3\python.exe
if you did not create any further environments (if you never invoked conda create -n my_env python=3
).
You can get a list of your current environments with conda info -e
and switch to one of them using activate my_env
.
It seems that each project may have a separate collection of python libraries in a project specific computing environment. To get this working with numpy
I went to the terminal at the bottom of the pycharm window and ran pip install numpy
and once the process finished running the install and indexing my python project was able to import numpy from the line of code import numpy as np
. It seems you may need to do this for each project you setup in numpy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With