SciPy/Python install on Ubuntu

前端 未结 8 1214
轻奢々
轻奢々 2020-12-04 23:54

I\'m currently following the tutorial Installing the SciPy Stack to install SciPy on Ubuntu 12.04 (Precise Pangolin) (I can\'t use apt-get install

8条回答
  •  忘掉有多难
    2020-12-05 00:37

    My usual work flow is to use a virtualenv to have a Python distribution with up-to-date packages.

    Within this environment you can than install and update all packages you need with pip and without any sudo calls.

    So if you only need SciPy (and NumPy) this would be:

    $ sudo apt-get install python-virtualenv python-pip
    $ sudo apt-get build-dep python-numpy python-scipy
    $ # Create virtualenv in home
    $ virtualenv .myenv
    $ # Activate the virtualenv
    $ source .myenv/bin/activate
    (myenv)$ pip install -U numpy
    (myenv)$ pip install -U scipy
    

    (If you don't have root access, you can install virtualenv and pip as described here. However, you need the dependencies of NumPy and SciPy.)

    You can include source .myenv/bin/activate in your .bash_profile and your shell will always start with that environment. If you use requirement files it is easy to install and maintain the same environments on all your machines.

提交回复
热议问题