0
votes

I installed anaconda and my python script is showing this error even I installed numpy;

Traceback (most recent call last): File "rbm_chords.py", line 3, in import numpy as np File "/home/sonu/anaconda3/envs/my_env/lib/python2.7/site-packages/numpy/init.py", line 146, in from . import add_newdocs File "/home/sonu/anaconda3/envs/my_env/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in from numpy.lib import add_newdoc File "/home/sonu/anaconda3/envs/my_env/lib/python2.7/site-packages/numpy/lib/init.py", line 8, in from .type_check import * File "/home/sonu/anaconda3/envs/my_env/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in import numpy.core.numeric as _nx File "/home/sonu/anaconda3/envs/my_env/lib/python2.7/site-packages/numpy/core/init.py", line 24, in raise ImportError(msg) ImportError: Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. If you're working with a numpy git repo, try git clean -xdf (removes all files not under version control). Otherwise reinstall numpy.

Is there any way to select all the libs of conda in a particular environment. The only suggestion I got after searching over web is to uninstall anyone.My script is working in python 2.7 and working perfectly with the default python.

1
Did you by any chance use pip to install numpy?juanpa.arrivillaga
I used conda -f install numpy and conda -f install numpy in the conda environment.Sonu Chauhan
conda -f? What does the -f do? Any links? I can't find it in the help message.juanpa.arrivillaga
ohkk . This is fault .Sonu Chauhan
but do i need to install all the packages in all environments that I'll create?Sonu Chauhan

1 Answers

0
votes

It seems like you're using python3 version of Anaconda but the default python for Ubuntu is python2.7

This may help you:

https://www.digitalocean.com/community/tutorials/how-to-install-the-anaconda-python-distribution-on-ubuntu-16-04