pramesh shakya
pramesh shakya

Reputation: 143

import numpy not working in IDLE

I have python3.5.2 installed on a windows10 machine(Adding into the pythonpath is included in the setup with new python). I ,then, installed the Anaconda(4.2.0) version. At the command prompt when i run the python interpreter and import numpy it works fine. But when i save it as a script and try running from the IDLE, it gives

Traceback (most recent call last): File "C:\Users\pramesh\Desktop\datascience code\test.py", line 1, in <module> from numpy import * ImportError: No module named 'numpy'

I don't know what the problem is. I donot have any other python version installed.

Upvotes: 3

Views: 7746

Answers (3)

Sangram Deshpande
Sangram Deshpande

Reputation: 1

Just use python -m before pip command, so that you won't get any problem while doing so in IDLE.. ex. python -m pip install scipy/numpy

Upvotes: 0

gbe
gbe

Reputation: 681

You do have two versions of python installed: the CPython 3.5.2 distribution you mention first, and the Anaconda 4.2.0 Python distribution you then mention. Anaconda packages a large number of 3rd party packages, including Numpy. However, the CPython 3.5.2 installation available on python.org only ships with the standard library.

These two python installs have separate package installations, so having Anaconda's numpy available doesn't make it available for the CPython install. Since you're starting the Idle with shipped with CPython, which doesn't have numpy, you're seeing this error. You have two options:

  • Install numpy for CPython. See numpy documentation for details on how to do this, but it may be difficult.
  • Use the version of Idle included with Anaconda. This should be available in the Anaconda programs folder.

Upvotes: 2

Moid
Moid

Reputation: 440

If you want to use pip in Anaconda Command Prompt, cd to C:\Anaconda\Scripts, and use pip from there.

after that, you can use pip command. pip install fuzzywuzzy

just instead of fuzzywuzzy install numpy there. that'll surely work

Upvotes: 0

Related Questions