2

I am quite new to python and pycharm.
I installed python 3.6 through anaconda, and I can see many packages including numpy are installed as I can see them in cmd (im using windows) by typing 'conda list'. Also, it works if i type 'import numpy' in python through window command prompt.

However, if I open pycharm and run "import numpy" there, it gives me 'No module named 'numpy' in pycharm'. May I know whats wrong with my setting? I guess it must be some problem with my interpreter setting.

I think my python is installed in C:\Users\AAA\Anaconda3\python.exe I checked in pycharm, project interpreter is "C:\Users\AAA\PycharmProjects\untitled\venv\Scripts\python.exe"

Should I change it to the one under anaconda3 folder?
What is venv folder under "pycharmprejcts"? Is it a virtual environment? It shows (see the attached screenshot) the base interpreter is the one under anaconda? Should I choose to inherit global site-packages?

Please click here to see the screenshot of my current project interpreter location

2 Answers 2

2

You should select Conda environment in Pycharm, not create a new, blank Virtualenv

Or at the very least - System interpreter, then find the Python executable for Anaconda

What is venv folder under "pycharmprejcts"? Is it a virtual environment?

Yes, it allows your project to be more portable - you define the minimum set of dependencies for your code rather than rely on everything installed only locally on your machine

Sign up to request clarification or add additional context in comments.

1 Comment

I'll add comment since it took me some time.(PyCharm 2018.3.3) First you'll need to set up a new system interpreter and select your python interpreter. You can go to File>Python project>Click Gear and select System interpreter. Select your desired interpreter. You can now import modules.
0

You have a virtual environment, this helps keep the dependencies separate between projects. You can set your project interpreter to C:\Users\AAA\Anaconda3\python.exe or install the dependency in your venv, in pycharm you would press alt+enter on the import and press install.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.