I have installed both python3-numpy as well as python-numpy from the App store. But then, numpy only works on python3. I want it to work on python2.7 also.
Asked
Active
Viewed 147 times
1
1 Answers
0
I have solved the issue. This problem was caused by my earlier installation of another software, which is called PSI4. PSI4 is a quantum chemistry software, which was built in a way that it also includes python2.7.10. Therefore, after the installation, when I typed the command "python", something as below will show up:
cpjwong@cpjwong-OptiPlex-9020:~$ python
Python 2.7.10 |Continuum Analytics, Inc.| (default, Sep 15 2015, 14:50:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>>
You can see the company name "Continuum Analytics, Inc.", which implies that the pre-installed python2.7 in ubuntu 14.04 has been overwritten. The numpy for this version of python can be installed by firstly downloading numpy-1.7.0.tar.gz and then run the following command:
tar xvzf numpy-1.7.0.tar.gz
cd numpy-1.7.0/
python setup.py build
python setup.py install
cd ..
Then, you can check whether numpy is properly installed by typing the following command:
cpjwong@cpjwong-OptiPlex-9020:~$ python
Python 2.7.10 |Continuum Analytics, Inc.| (default, Sep 15 2015, 14:50:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import numpy
>>>

Jeremy Wong
- 49
pip
orapt-get
or the Software Center? – Byte Commander Sep 18 '15 at 10:15sudo apt-get install python-numpy
. – Byte Commander Sep 18 '15 at 10:29sudo apt-get install python-numpy && python2 -V && python2 -c "import numpy; print numpy.__version__"
– Byte Commander Sep 18 '15 at 11:00