BABrady27
BABrady27

Reputation: 33

Can't access Python modules

I can't get any python modules to install, please help me if you can.

I'm running Windows and I have python 3.5.1 (v3.5.1:37a07cee5969) [MSC v.1900 64 bit (AMD64)] on win32. Python35 is installed to C:\Python35. I also have Anaconda3 installed. I've set up PATH to include: (C:\Python35\Scripts\;C:\Anaconda3;C:\Anaconda3\Lib\site-packages\;C:\Anaconda3\Scripts), which I think encompasses everything I need for that.

Specifically, I'm trying to install Numpy, Pandas, and the Quandl module using pip install. From the command prompt, I've already done "conda install numpy", "conda install pandas", and "conda install Quandl", all of which installed and I can find them in C:\Anaconda3\Lib\site-packages\, but when I go to the command prompt and access python, and then enter "import numpy" (or pandas), it returns a Traceback error - ImportError: No module named 'numpy' ('pandas'). When I try to enter "import Quandl", it errors returning:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python35\lib\site-packages\Quandl\__init__.py", line 11, in <module>
    from .Quandl import (
  File "C:\Python35\lib\site-packages\Quandl\Quandl.py", line 11, in <module>
    import pandas as pd
ImportError: No module named 'pandas'

For more information, when I attempt to do 'pip install numpy' from command prompt, it errors out on a lot of things stating "NOT AVAILABLE", and at the bottom is states:

Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\BradyA\\AppData\\Local\\Temp\\pip-build-9t5yqzmk\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\BradyA\AppData\Local\Temp\pip-i6hj44h_-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\BradyA\AppData\Local\Temp\pip-build-9t5yqzmk\numpy\

Any thoughts? Thank you.

Upvotes: 3

Views: 9006

Answers (3)

Ganesh Kathiresan
Ganesh Kathiresan

Reputation: 2088

Here is a solution that worked for many:

  1. Open cmd as admin.
  2. Go to required pythons scripts folder: C:\Python34\Scripts
  3. Now type pip pip install --upgrade pip(just a check)
  4. For NumPy (you cannot do it directly)(others also):

    4.1. Download all the packages you need from here :

    4.2. Now type : pip install [file location of package]

    4.3. This should do the trick.

Note: For more detailed explanation please look at this tutorial

Keep me posted on the progress.

Upvotes: 3

Xexeo
Xexeo

Reputation: 302

It seems that you have conflict between the two different installations of Python.

I had similar problems in the past and deleted all Pythons, cleaned the path and reinstalled Anaconda and used Anaconda environments to work with multiple versions of Python.

Installing with conda should work with you have just Anaconda.

Upvotes: 1

aleksk
aleksk

Reputation: 711

Try run your command prompt as an administrator, then issuing the pip install commands.

Upvotes: 2

Related Questions