[CentralOH] Installing Python on Linux from Source?

Max kedlav at gmail.com
Fri Jan 13 23:09:40 EST 2017


For Enterprise Linux distros, you can generally find packages using
rpmfind.net.  Some are put together by less well known packagers, so please
be careful.  The IUS repo is probably your best bet if you're not on fedora
to get the latest upstream packages from a reliable team and not breaking
namespaces.

For ubuntu, 16.10 and above have python3.6 packaged and ready.  If you're
on an older version (which is a reasonable guess), you can get all versions
through 3.5.1 from this repo:
https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes.  Alas, the
maintainer ran out of time to be able to support this.  As I tend to run a
lot more on enterprise linux... I really can't recommend much else.

An alternative is to switch to using anaconda (once they upgrade, they are
slower as they have a *lot* of stuff to maintain and test).  This works
cross-platform (windows, mac, most varieties of linux) and is highly
recommended if your sysadmin skills aren't strong.

-Max

On Fri, Jan 13, 2017 at 8:01 PM, pybokeh <pybokeh at gmail.com> wrote:

> 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
>
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> https://mail.python.org/mailman/listinfo/centraloh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20170113/7dd349b6/attachment.html>


More information about the CentralOH mailing list