[CentralOH] Installing Python on Linux from Source?

pybokeh pybokeh at gmail.com
Fri Jan 13 20:01:59 EST 2017


Just curious if there is a better way to install a Python version from
source on Linux and then make virtual environment using that new Python
version.

Here are my steps / procedure:
# Install necessary dependencies
sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev
sudo apt-get install libreadline-dev libncursesw5-dev libncurses5-dev
zlib1g-dev libssl-dev tk-dev

# Download source:
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz

# Extract, configure, make, and make install
tar xf Python-3.5.1.tar.xz
cd Python-3.5.1
./configure --prefix=/opt/python3.5.1
make && sudo make install

# Find location of Python installation:
whereis python

# Create folder to contain your virtual environments:
mkdir ~/envs
cd ~/envs

# create bottle virtual environment using Python 3.5's venv
/opt/python3.5.1/bin/python3.5 -m venv bottle

# Activate bottle environment:
cd bottle
source bin/activate
pip --version           # confirm pip/python version

# Install packages:
pip install <package_name>

# deactivate virtual environment:
deactivate

- Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20170113/4d352bf9/attachment.html>


More information about the CentralOH mailing list