0

I am running Windows 7 Professional

I have installed Python 3.6

My version was verified by pip --version to give the following:

pip 9.0.1 from C:\ProgramData\Miniconda3\lib\site-packages (python 3.6)

Using PIP I have installed NumPy and SciPy by the following:

pip install numpy
pip install scipy

I can verify the instalation using pip list to show:

cffi (1.9.1)
conda (4.2.13)
cryptography (1
idna (2.2)
menuinst (1.4.4
numpy (1.12.1+m
pip (9.0.1)
pyasn1 (0.1.9)
pycosat (0.6.1)
pycparser (2.17
pyOpenSSL (16.2
pywin32 (220)
requests (2.12.
scipy (0.19.0)
setuptools (27.
six (1.10.0)
wheel (0.29.0)

In the command prompt I can type python, and then import scipy like so:

C:\Users\james.hayek\Desktop>python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 11:57:41) [MSC v
.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>>

It would appear as if everything has installed correctly. However, when I start IDLE and type import scipy I get the following error:

>>> import scipy
Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    import scipy
ModuleNotFoundError: No module named 'scipy'
>>> 

Any idea's how I can call/import SciPy in IDLE?

James Hayek
  • 643
  • 3
  • 10
  • 35
  • Do you have more than one version of python installed? Check the version of python that IDLE is running. – Trevor May 03 '17 at 17:13
  • @Trevor I only have one version of Python installed. IDLE shows Python 3.6.1 Shell – James Hayek May 03 '17 at 17:36
  • @Trevor I only installed one version of Python... But it seems like CMD shows Python 3.6.0 and IDLE says Python 3.6.1 Shell in its title. I'm not sure how to correct this. – James Hayek May 03 '17 at 17:47

1 Answers1

1

Your Miniconda package has made its own Python SDK default. You need to run your IDLE and add Miniconda's site-packages directory to your regular PYTHONPATH:

import sys print(sys.path) # to verify that Miniconda is not in this PYTHONPATH sys.path.append('C:\ProgramData\Miniconda3\lib\site-packages')

To check your path you can equally go to File -> Path Browser

dr_dronych
  • 91
  • 4
  • Well, you are exactly correct. Thanks!! So, now that I added Miniconda to the PYTHONPATH in IDLE I can run the module. However, when I close IDLE and reopen, I have to append the path again. Is there a way to set this once? – James Hayek May 03 '17 at 19:24
  • To achieve this, please follow the instructions to modify your environment variables as described in [this](http://stackoverflow.com/questions/28416182/setting-path-for-python-in-powershell) question. Add your Miniconda's site-packages to the PATH. I would highly recommend to start working with the instruments like `virtualenv` to avoid confusion and ensure library compatibilities. – dr_dronych May 04 '17 at 02:23
  • I actually did that. It still is not being recognized. Here is my PATH contents: C:\ProgramData\Miniconda3\lib\site-packages; C:\Users\james.hayek\AppData\Local\Programs\Python\Python36-32\Scripts\; C:\Users\james.hayek\AppData\Local\Programs\Python\Python36-32\; C:\Python27\Scripts; – James Hayek May 04 '17 at 15:53
  • You should work with the `Path` system variable, not `PATH` then. Add your Miniconda directory there. – dr_dronych May 04 '17 at 19:11
  • In the system properties advanced tab, I chose enviornment variables, then under the System Variables section I was a variable called "Path" I have added the directory path there to no avail. Still doesnt work.. not sure why – James Hayek May 04 '17 at 19:40
  • The path content for MiniConda is here: ;C:\ProgramData\Miniconda3;C:\ProgramData\Miniconda3\Scripts; C:\ProgramData\Miniconda3\Library\bin; C:\ProgramData\Miniconda3\lib\site-packages; – James Hayek May 04 '17 at 19:41
  • 1
    Let's do the workaround here: 1.Identify the default directory that you've got from python.org do `import sys; print(sys.executable)` in IDLE. 2. Set up new system variable called PYTHONHOME with the values `path_to_orig_interpreter, e.g. C:\Python27`; use 1 to ensure. 3. Modify your `Path` to include `%PYTHONHOME%; %PYTHONHOME%\DLLs; C:\ProgramData\Miniconda3\lib\site-packages` You can alternatively install numpy and scipy directly from IDLE. Read more [here](http://stackoverflow.com/questions/40364945/run-pip-in-idle). Installs them into the site-packages of your IDLE's 'environment'. – dr_dronych May 05 '17 at 05:26
  • Looks like I can't follow directions, I had trouble doing the above. HOWEVER, I was able to uninstall Python and by using the approach given to install from IDLE, I decided to take a similar approach using conda. Once Python was uninstalled I reinstalled it using Conda, which then upgraded Python 3.6.0 to 3.6.1 and now all the libraries work. Thank you @dr_dronych – James Hayek May 05 '17 at 15:22