How do you use Python 3.5 and Python 3.6 in production

Chris Angelico rosuav at gmail.com
Wed Jun 14 21:37:44 EDT 2017


On Thu, Jun 15, 2017 at 9:46 AM, Amirouche Boubekki
<amirouche.boubekki at gmail.com> wrote:
> I'd like to use Python 3.5 or Python 3.6 in production but avoid the use of
> pip and virtualenv.
>
> Is there a solution based on a popular GNU/Linux distribution that allows
> to keep up with the release of Python 3.x and various other highly prolific
> project but still young like aiohttp?
>
> What I am looking for is the ability to have reproducible builds in the
> form of lxc templates (or maybe somekind of docker magic) but without the
> need to maintain another package repository.
>
> I hope my question is clear.

I generally build the very latest from source control. (Presumably
it'll be the same if you get a .tar.gz archive, but I haven't tested
it.) Either way, you'll generally do something like this:

$ sudo apt build-dep python3
$ ./configure
$ make
$ sudo make install

and that should give you a fully working Python. And here's the thing:
for a modern Python, "fully working" includes having pip available.
I'm not sure what the advantage is of avoiding pip, but if your idea
is to avoid trampling on the system Python, the easiest way is to use
the inbuilt venv (rather than the third-party virtualenv) and use
that.

To keep up with projects like aiohttp, you're either going to need to
use pip, or you're going to install them manually. I strongly
recommend the former.

$ python3 -m venv env
$ source env/bin/activate
$ pip install aiohttp

That's usually the safest way to do things IMO.

ChrisA



More information about the Python-list mailing list