crazymav
crazymav

Reputation: 55

How to install scipy and numpy packages for python 3.4 on ubuntu 12.04?

I have tried installation with the following command:

sudo apt-get install python3-numpy python3-scipy    

This installs the related packages for python 3.2. What should I do to install scipy and numpy for python >=3.4.2 ?
I have read the previous answers for the other questions on stack overflow regarding same issue but none have provided me with solution.

Please help

Upvotes: 1

Views: 1010

Answers (2)

ev-br
ev-br

Reputation: 26040

You can get various versions of python interpreters from

https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes

Then you can install virtualenvwrapper, and $ mkvirtualenv foo -p python-interpreter-you-want. This way, you get a virtualenv where you can pip install whatever you wish.

Demo: Here py35 is a virtualenv specifically for a python3.5 executable from the DeadSnakes repo linked above.

$ which python3.5
/home/br/virtualenvs/py35/bin/python3.5
$ workon py35
(py35)$ which python
/home/br/virtualenvs/py35/bin/python
(py35)$ ll /home/br/virtualenvs/py35/bin/python
lrwxrwxrwx 1 br br 9 Nov 12 16:21 /home/br/virtualenvs/py35/bin/python -> python3.5*

Notice that in the virtualenv, python is just a simlink to the executable you specified via the -p switch to mkvirtualenv.

Upvotes: 0

otterb
otterb

Reputation: 2710

I recently started using anaconda on Linux Mint and it really made my life much easier.

you can get miniconda here http://conda.pydata.org/miniconda.html

if you need to use 3.4 rather than 3.5 which is the defaul python3 for anaconda now, then you can create a separate env using python34

conda create -n myenv python=3.4

or just

conda create -n myenv python=3

to let conda pick the latest supported version

then

conda install -n myenv numpy=0.15.0

etc to install what you need. you can leave out the version too.

finally do

source activate myenv

to switch to the python interpreter of myenv.

Upvotes: 1

Related Questions