To run the commands in this article, you must log into your server via SSH with your Shell user. View the following articles for more information:
pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well. Follow the instructions here:
Since the user doesn't have permission to the /var/foo/bar/tmp folder, you will have a "BUILD FAILED" error. Make sure you create a tmp folder in your home folder and tell pyenv to use it:
[server]$ cd ~ [server]$ mkdir tmp [server]$ echo 'export TMPDIR="$HOME/tmp"' >> ~/.bash_profile
Due to resource limitations on shared hosting, your processes may be killed when compiling math modules such as numpy, pandas, matplotlib, etc. The best solution is to use `anaconda` or `miniconda` packages under `pyenv`.
[server]$ pyenv update
Check what's available
[server]$ pyenv install --list
Install the version you desire
[server]$ pyenv install anaconda-x.x.x
Once you have `anaconda` as your Python environment, you can use `conda install` to install precompiled math modules, without the hassle of compiling. View the following article for further information:
See also
- Python overview
- SSH overview
- Guidelines for setting up a Python file at DreamHost
- How to install a newer version of SWIG
- Installing a custom version of Python 2
- Installing a custom version of Python 3
- Installing and using virtualenv with Python 2
- Installing and using virtualenv with Python 3
- Python setuptools