메모

$ phtyon –version
Python 2.7.6
$ sudo apt-get install python-numpy
[sudo] password for diane:
Reading package lists… Done
Building dependency tree
Reading state information… Done
python-numpy is already the newest version.
python-numpy set to manually installed.
The following packages were automatically installed and are no longer required:
firefox-locale-ko liblouis-data liblouis2 libntdb1
linux-image-4.2.0-27-generic linux-image-extra-4.2.0-27-generic python-ntdb
python3-brlapi python3-louis python3-pyatspi python3-speechd
Use ‘apt-get autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

>>> import numpy as np
>>> data = np.arange(6).reshape(2,3)

sudo add-apt-repository ppa:fkrull/deadsnakes-python2.7
sudo apt-get update
sudo apt-get upgrade
(need higher version of python 2.7.9)

python –version
Python 2.7.12

Pip is a better alternative to Easy Install for installing Python packages. It is most “nutritious” when used with its companion virtualenv. For more information on pip and virtualenv see my blog post: Notes on using pip and virtualenv with Django.

$ sudo apt-get install python-pip python-dev build-essential
$ sudo pip install –upgrade pip
$ sudo pip install –upgrade virtualenv

Leave a Reply