[Neuroimaging] Technical details managing Python versions and packages.

Ariel Rokem arokem at gmail.com
Fri Jul 31 20:13:30 CEST 2015


On Fri, Jul 31, 2015 at 10:50 AM, Nolan Nichols <bnniii at uw.edu> wrote:

> ​Not exactly what you asked for, but one suggestion is to standardize your
> approach to installing packages. From my early experience with Python,
> package management was notoriously confusing and mixing apt-get,
> easy_install, and pip was a recipe for disaster.
>
> I've switched to using the "Anaconda" distribution of Python and it has
> made installing libraries a really smooth process. I use "miniconda" (
> http://conda.pydata.org/miniconda.html) and the "conda" tool to install
> anything available in their software registry and then I use 'pip' to
> install everything else. I steer clear of apt-get and easy_install.
>
> Conda also makes it super easy to create sandboxed environments to test
> out new tools. For example, once miniconda is installed you can:
>
> # create an environment to use nibabel
>> conda create -n nibabel-env pip ipython scipy
>> # activate the environment
>> source activate ​nibabal
>> # use pip to install a libary not available through conda
>> pip install nibabel
>> # turn off the nibabel environment and switch back to the main
>> installation
>> source deactivate
>
>
>
Moreover, you can do things like:

conda create -n nibabel-py2 python=2.7 pip ipython scipy

or

conda create -n nibabel-py3 python=3.4 pip ipython scipy

To create envs with different versions of python (or any other library,
e.g. `numpy=1.6`)


> ​If you give that a shot it will essentially ignore everything else you've
> installed and give you a clean slate to work from.​
>
>
> ​Cheers,
>
> Nolan​
>
>
> On Fri, Jul 31, 2015 at 10:29 AM, Jesus-Omar Ocegueda-Gonzalez <
> jomaroceguedag at gmail.com> wrote:
>
>> Hello Python experts!,
>> I just wanted to ask if anyone of you could point me out to a good
>> reference to learn a good way to manage different python versions and their
>> corresponding packages. This is a bit embarrassing, but I guess the
>> following story may seem familiar to some people (probably those days when
>> you were python newbies): I had python 2.7 with a lot of packages already
>> installed, some of them installed with pip, some with easy_install, some
>> with apt-get, some built manually from source code... who knows? I just
>> sequentially tried each installation way, following instructions I found in
>> random internet pages whenever something went wrong, until one of the
>> installation instructions suddenly worked, and just moved on. Then, at some
>> point, I tried to install Python 3 to reproduce a bug reported to only
>> happen there, just to discover that now nothing works, I have no numpy, no
>> nibabel, none of the basic packages, so I tried to "re-install" them
>> (following instructions from random internet pages when something goes
>> wrong... again), see the pattern?. So the root cause is obviously that I
>> have no idea of what's going on behind scenes when I use these "mysterious"
>> installers, and how they affect my environment, which of them are
>> compatible with each other and which are not, etc.
>>
>> So, to break the pattern, I think this is time to really learn exactly
>> what's going on when we "install" packages with different tools, and how to
>> correctly manage different versions. Could anyone point me out to a good
>> reference to learn these details (e.g. Is there a good way to actually
>> remove everything so we can start a totally fresh installation)?
>>
>> Thank you very much in advance!.
>> With warm regards,
>> -A frustrated -but motivated- Python user.
>> --
>> "Cada quien es dueño de lo que calla y esclavo de lo que dice"
>> -Proverbio chino.
>> "We all are owners of what we keep silent and slaves of what we say"
>> -Chinese proverb.
>>
>> http://www.cimat.mx/~omar
>>
>> _______________________________________________
>> Neuroimaging mailing list
>> Neuroimaging at python.org
>> https://mail.python.org/mailman/listinfo/neuroimaging
>>
>>
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150731/c34e5e4a/attachment-0001.html>


More information about the Neuroimaging mailing list