This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
working_with_python [2018/08/30 07:49] – [Bypassing the existing python environment] lenocil | working_with_python [2019/04/23 13:25] – jansen | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Working with Python ====== | ====== Working with Python ====== | ||
- | Python is available on all Sterrewacht and Lorentz Institute GNU/Linux workstations. In most cases, both python 2 (currently 2.7) and python 3 (currently 3.6) are available. | + | Python is available on all Sterrewacht and Lorentz Institute GNU/Linux workstations. In most cases, both python 2 (currently 2.7) and python 3 (currently 3.7) are available. |
Notes from a [[https:// | Notes from a [[https:// | ||
Line 67: | Line 67: | ||
* When globally installed packages are on the python path, and they satisfy the installation requirements, | * When globally installed packages are on the python path, and they satisfy the installation requirements, | ||
* pip will not perform a --user install in a virtualenv unless the virtualenv was created specifying '' | * pip will not perform a --user install in a virtualenv unless the virtualenv was created specifying '' | ||
+ | |||
+ | === Method 1 - subsection Incompatible versions === | ||
+ | |||
+ | Unfortunately, | ||
+ | |||
+ | In cases like this, it might be necessary to create a separate python user directory structure for those machines: | ||
+ | |||
+ | Add to your .bashrc something like this: | ||
+ | if [ ! -f / | ||
+ | export PYTHONUSERBASE=$HOME/ | ||
+ | fi | ||
+ | For users of the '' | ||
+ | if (! -f / | ||
+ | setenv PYTHONUSERBASE $HOME/ | ||
+ | endif | ||
+ | |||
+ | And make sure to create that directory ~/ | ||
==== METHOD 2: virtualenv ==== | ==== METHOD 2: virtualenv ==== |