[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-distutils-sig
Subject:    Re: [Distutils] Problems using pip on Ubuntu when 2.7, 3.4 and 3.5 are installed
From:       Nick Coghlan <ncoghlan () gmail ! com>
Date:       2016-01-09 9:26:32
Message-ID: CADiSq7f0-F2fB9unNBon48BTu2Q6ymDG0Juc0LhkQGj88vEvQw () mail ! gmail ! com
[Download RAW message or body]

On 8 January 2016 at 19:18, ars technica <arstechnica@contractor.net> wrote:
> Hi,
>
> thank you for the tutorial here
> https://docs.python.org/3.5/installing/index.html
>
> I have a problem using pip to install packages to 3.5. I now have three
> versions installed and pip only addresses the two old ones.
>
> The command pip installs to 2.7
> pip3 installs to 3.4 and that leaves 3.5 all alone.
>
> I tried to install numpy with the command
> python3.5 -m pip install numpy

In the absence of a virtual environment, using "-m" as you have done
here is the right way to invoke pip while ensuring it's using the
intended Python installation.

> but got the error that Python.h could not be located. When asked bash
> locate Python.h
>    it returned
> /usr/local/include/python3.4m/Python.h

This is where things can get a bit messy, since Linux tends to assume
system-wide builds by default.

> My question therefore is. How do I setup my environment to be able to
> install packages to all the Python versions? Should I do a
> virtualenvironment for each version or can I change some configuration file
> to let PIP know that it should check the Py3.5 folder when desired?

If you're fine with building NumPy from source yourself, then creating
a virtual environment for each version should work. However, I believe
there may still be some potential to end up running into missing
header files for some of NumPy's external dependencies when building
for a Python version that wasn't provided by your distro.

If you'd prefer to avoid any configuration and debugging of
C/C++/FORTRAN build processes, then you may prefer to grab miniconda
and download distro-independent pre-built binaries:
http://conda.pydata.org/miniconda.html

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan@gmail.com   |   Brisbane, Australia
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic