10

So I have been having some trouble with this. I need to use numpy so that I can use OpenCV and so I installed Miniconda (Not Miniconda3 because we are working in Python 2.7) and I installed numpy with conda install numpy and it worked because when I run conda list I see that it is there:

Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\joe30_000>conda list
# packages in environment at C:\Users\joe30_000\Miniconda:
#
conda                     3.17.0                   py27_0
conda-env                 2.4.2                    py27_0
menuinst                  1.0.4                    py27_0
numpy                     1.9.3                    py27_0
pip                       7.1.2                    py27_0
pycosat                   0.6.1                    py27_0
pycrypto                  2.6.1                    py27_3
python                    2.7.10                        0
pyyaml                    3.11                     py27_2
requests                  2.7.0                    py27_0
setuptools                18.3.2                   py27_0
wheel                     0.26.0                   py27_1

C:\Users\joe30_000>

And as you can see it is installed for Python 2.7. However, when I go to the python command line and try import numpy I get the error that no module exists:

Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named numpy
>>>

Why is this happening? Do I have to somehow sync Conda with Python so that Python is using the modules that Miniconda has installed?

MagnusCaligo
  • 707
  • 2
  • 8
  • 28
  • Are you running the miniconda python or some other arbitrary python installed on your system? – Robert Horvick Sep 28 '15 at 00:53
  • @Bubbafat im running the standard python for 2.7 that I installed... is there a "miniconda" versión of python? – MagnusCaligo Sep 28 '15 at 00:55
  • 1
    Says so right in your list of modules. This is pretty much the point of conda. You can have environments that are 2.7 or 3.2 or whatever you want. Miniconda is conda package + python. It doesn't have the hundreds of other packages anaconda has. But it doesn't mean you should use an external python. – Robert Horvick Sep 28 '15 at 02:00

1 Answers1

10

So thanks to @Bubbafat, I found the solution and I want to post it in case anyone else has problems. Like Bubbafat said, conda has its own version of the Python interpreter. It is located in the Miniconda directory (It's called "Python.exe"). If you are using an IDE you need to switch the interpreter to use this version of Python rather than the default one you may have installed on the internet from the Python website itself. I hope this was helpful.

MagnusCaligo
  • 707
  • 2
  • 8
  • 28
  • 3
    If you ever create a [conda environment](http://conda.pydata.org/docs/using/envs.html) (other than the default root) you will actually have multiple conda Pythons installed and might end up back in this situation - just be aware of that. :) – Robert Horvick Sep 28 '15 at 14:26
  • @MagnusCaligo did you ever have a problem with Python just hanging after you pointed your $PATH to Miniconda's Python.exe? – J-Win Jul 11 '17 at 02:36