lefaa_783
lefaa_783

Reputation: 37

import numba on mac Sierra

I'm trying to install NUMBA on a mac machine (10.12.6). I've tried with CONDA:

conda install numba

I'm getting this:

Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at /Users/lefaa/miniconda2:
#numba                     0.35.0              np113py27_6 

This seems good, however when I try (using python 2.7):

python -c "from numba import jit" 

I'm getting that the numba module isn't installed:

Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numba

Do I have to configure something else?

Upvotes: 0

Views: 465

Answers (2)

lefaa_783
lefaa_783

Reputation: 37

I solved the issue. Indeed, when installing with conda, conda installs the target package in python associated to conda (i.e, in this python '/Users/lefaa/miniconda2/bin/python'). So to import numba, it is necessary to lunch the python of miniconda. However, to install numba on the main python (python2.7), one solution will be to install like this '/usr/local/bin/pip2.7 install numba'.

Upvotes: 0

JoshAdel
JoshAdel

Reputation: 68682

It is likely that your path is not set up correctly and the python that conda installed numba into is not the one you are running. If you run which python you should get the one that's in your miniconda2 if everything is working properly. If you get a different python executable then you probably need to set your PATH environment variable. See:

https://conda.io/docs/user-guide/install/index.html#installing-conda-on-a-system-that-has-other-python-installations-or-packages

Upvotes: 2

Related Questions