How to create development Python environment on Linux.

Marc Brooks marcwbrooks at gmail.com
Wed Jun 1 20:30:50 EDT 2016


I am pretty sure (but not 100%) that the pip that virtualenv installs when
it first creates the virtualenv is the version of pip installed on the
system.  Here's the process I used to bootstrap a new Python 2.7 dev
environment.

1. Download and install the latest version of pip as sudo so it's system
wide.
2. Install virtualenv and virtualenvwrapper (a collection of utilities
scripts/aliases for virtualenv).
3. Update my .bash_profile to source the virtualenvwrapper script.

Then for any new virtualenvs I just type 'mkvirtualenv <foo>'

I can update the version of pip in the virtualenv or run pip install for
any of my required libraries at that point.  One wrinkle that can come up
is if you want to use virtualenvwrapper and you are not using bash.  Fish
(another moderately popular shell) has an addon that mimics the macros that
virtualenvwrapper provides.

Mar

On Wed, Jun 1, 2016 at 8:17 PM, Lawrence D’Oliveiro <lawrencedo99 at gmail.com>
wrote:

> On Tuesday, May 17, 2016 at 4:26:23 AM UTC+12, Zachary Ware wrote:
> > Not what you asked for, but I would encourage you to look into whether
> > it's possible for you to use Python 3 instead of Python 2 for what
> > you're doing.  If it's possible, starting with Python 3 will save you
> > several headaches in the future.
>
> Let me add my vote for this.
>
> > sys.prefix is baked in at compile time of the python interpreter ...
>
>     ldo at theon:~> ~/virtualenv/jupyter/bin/python -c "import sys;
> print(sys.prefix)"
>     /home/ldo/virtualenv/jupyter
> --
> https://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list