pip install environment vs. conda install environment

0 views
Skip to first unread message

Mike Hagerty

unread,
Jul 23, 2016, 11:48:54 AM7/23/16
to conda - Public
python, conda and pip are all installed on my mac os x laptop via the Anaconda distribution.

Installing new packages with 'conda install ...' works perfectly.

However, when conda doesn't contain a package I want (e.g., gmpy2), I try to install it
with pip - e.g., pip install gmpy2.

When I do this, I invariably get errors related to gcc - missing include dirs, missing libgcc dir, etc.

I don't think I've done anything to configure Anaconda's pip, so I guess it doesn't set the
envs correctly as conda does.  I haven't checked, but I assume (?) that conda is hitting
the same gcc/libgcc build env on my system that pip is trying to use.

Does anyone else have this issue and/or have a fix for it ?

Thanks!

Eric Dill

unread,
Jul 23, 2016, 9:55:35 PM7/23/16
to conda - Public
Did you install `pip` via `conda`? What's the output of `which conda`, `which pip`, `conda info -a` and `conda list`?

Mike Hagerty

unread,
Jul 25, 2016, 9:50:16 AM7/25/16
to Eric Dill, conda - Public
Yes, as I believe I said in my post - I installed both pip and conda via the anaconda installer.

On Sat, Jul 23, 2016 at 9:55 PM, Eric Dill <thed...@gmail.com> wrote:
Did you install `pip` via `conda`?  What's the output of `which conda`, `which pip`, `conda info -a` and `conda list`?

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/efdbe218-639f-42d5-926e-b6240ae3f85f%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Paul Hobson

unread,
Jul 25, 2016, 12:20:23 PM7/25/16
to m.ha...@isti.com, Eric Dill, conda - Public
Mike,

Eric's second question is the more import one. What are the outputs of:
`which conda`;
`which pip`;
`conda info -a`; and 
`conda list` 

Mike Hagerty

unread,
Jul 25, 2016, 12:37:27 PM7/25/16
to Paul Hobson, Eric Dill, conda - Public
Hi Paul,
I checked which pip before I posted (that's how I know it's the anaconda pip).

Also, I have both python 2.7 and 3.5 installed via conda and I can switch between them
with no problem.

Here I am only referring to 2.7.

Note: the warning message below (re: binstar_client) is new I believe - this may be
related to my partial install of gmpy2 via pip ( I later installed it via conda forge).

The issue when I try to install a python module via pip is always something
to do with a missing include (.h file) or library (libgcc..o) that can't be located.
Some of this may be my own fault - I have both apple llvm and gnu gcc
compilers installed and I've never felt like I have complete control over
my c make environment when installing python modules.

However, I haven't touched the anaconda pip settings and
conda seems to work flawlessly when installing new python modules - ie,
it seems to have the correct paths to include + library directories that it needs.

So I guess I'm wondering if the anaconda pip environment is somehow different ?

Okay, version info to follow.

Thanks for your time!

-Mike

> which conda
/usr/local/anaconda/bin/conda
> which pip
/usr/local/anaconda/bin/pip
> conda info -a
Warning: somethings is wrong with binstar_client ('args' object has no attribute 'token')Current conda install:

             platform : osx-64
        conda version : 4.1.9
    conda-env version : 2.5.1
  conda-build version : 1.3.5
       python version : 2.7.12.final.0
     requests version : 2.10.0
     root environment : /usr/local/anaconda  (writable)
  default environment : /usr/local/anaconda
     envs directories : /usr/local/anaconda/envs
        package cache : /usr/local/anaconda/pkgs
         channel URLs : https://repo.continuum.io/pkgs/free/osx-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/osx-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : None
         offline mode : False
    is foreign system : False

# conda environments:
#
python2.6                /usr/local/anaconda/envs/python2.6
python3                  /usr/local/anaconda/envs/python3
root                  *  /usr/local/anaconda

sys.version: 2.7.12 |Anaconda 2.0.1 (x86_64)| (defaul...
sys.prefix: /usr/local/anaconda
sys.executable: /usr/local/anaconda/bin/python
conda location: /usr/local/anaconda/lib/python2.7/site-packages/conda
conda-build: /usr/local/anaconda/bin/conda-build
conda-convert: /usr/local/anaconda/bin/conda-convert
conda-env: /usr/local/anaconda/bin/conda-env
conda-index: /usr/local/anaconda/bin/conda-index
conda-metapackage: /usr/local/anaconda/bin/conda-metapackage
conda-pipbuild: /usr/local/anaconda/bin/conda-pipbuild
conda-skeleton: /usr/local/anaconda/bin/conda-skeleton
user site dirs:

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: <not set>
CONDA_ENVS_PATH: <not set>
DYLD_LIBRARY_PATH: /opt/oracle/instantclient_11_2
PATH: /Users/mth/.jenv/shims:/usr/local/anaconda/bin:/usr/local/anaconda/bin:/sw/bin:/sw/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/anaconda/bin:/usr/local/gradle-2.7/bin:/Users/mth/mth/Programs/bin:/Users/mth/mth/Programs/My_c/bin:/usr/local/mysql/bin:/Users/mth/.jenv/bin::/opt/oracle/instantclient_11_2:/Users/mth/mth/Programs/src/wphase_parallel_r247/bin:
PYTHONHOME: <not set>
PYTHONPATH: /Users/mth/mth/Projects/python_utils

License directories:
    /Users/mth/.continuum
    /Users/mth/Library/Application Support/Anaconda
    /usr/local/anaconda/licenses
License files (license*.txt):
Package/feature end dates:

Chris Barker

unread,
Jul 25, 2016, 1:58:48 PM7/25/16
to m.ha...@isti.com, Paul Hobson, Eric Dill, conda - Public
On Mon, Jul 25, 2016 at 9:37 AM, Mike Hagerty <m.ha...@isti.com> wrote:
I checked which pip before I posted (that's how I know it's the anaconda pip).

Also, I have both python 2.7 and 3.5 installed via conda and I can switch between them
with no problem.

Here I am only referring to 2.7.

Note: the warning message below (re: binstar_client) is new I believe - this may be
related to my partial install of gmpy2 via pip ( I later installed it via conda forge).

The issue when I try to install a python module via pip is always something
to do with a missing include (.h file) or library (libgcc..o) that can't be located.

What you are seeing here is the entire REASON for CONDA to EXIST :-)

if you try to pip install something, and you get an error having anything to do with compliation, then that means pip is trying to compile and install from source, and your system is not set up to do that for that package.

Python packages more or less fall into 3 categories:

1) pure python -- easy to install and use via pip, or conda, or paling old source tarballs.

2) pure C extension code: "all" you need is a basic system compiler and the "dev" package for python this is pretty easy to get set up, and then you can fairly easily install with pip or from a source tarball (or make a conda package)

3) extension code that relies on another language (I.e. fortran) and/or third part compiled libraries. If there is not conda package for it, you need to get your system set up to compile that language, and have all teh depended libs installed, etc. This can vary from fairly easy (apt-get install some_lib on linux) to a freaking nightmare (VTK on Windows !)

the entire reason conda exists is to support (3) for most folks that are not expert developers on their platform of choice.

pip is a bit of a mixture -- when you do "pip install", pip will try to find and install a binary "wheel". If one does not exist, it will try to download the source and compile it for you -- but if you are dealing with (3) is is VERY unlikely that will work.

conda, on the other hand, only install binary packages -- if one does not exist for the package at hand, you'll need to find a way to compile it :-)

In short: your inability to pip install liley has nothing to do with your conda setup -- but with the fact that the rest of your system is not set up to compile the package at hand.

Note that conda CAN help here -- by providing some dependent libs, etc, but you'll need to do some hand work to get that all set up.

First thing I"d do is see if someone else has already built a conda package for the package at hand:

$ anaconda search the_package_name

maybe you'll get lucky.
 
However, I haven't touched the anaconda pip settings and
conda seems to work flawlessly when installing new python modules - ie,
it seems to have the correct paths to include + library directories that it needs.

right -- that's because it isn't comiling anything when you conda install it -- that has already been done.

So I guess I'm wondering if the anaconda pip environment is somehow different ?


does a pip associated with a different python install  succesfully compile this package? If so, then there may  be some conda configuration issues.

 > conda info -a
Warning: somethings is wrong with binstar_client ('args' object has no attribute 'token')

this is odd -- I've been seeing this warning lately, too -- but I think it's harmless.

 
Current conda install:

             platform : osx-64
        conda version : 4.1.9
    conda-env version : 2.5.1
  conda-build version : 1.3.5
       python version : 2.7.12.final.0
     requests version : 2.10.0
     root environment : /usr/local/anaconda  (writable)
  default environment : /usr/local/anaconda
     envs directories : /usr/local/anaconda/envs
        package cache : /usr/local/anaconda/pkgs
         channel URLs : https://repo.continuum.io/pkgs/free/osx-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/osx-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : None
         offline mode : False
    is foreign system : False

so you've only got the default channels on there -- time to look for others :-)

hint: conda-forge has a lot!

DYLD_LIBRARY_PATH: /opt/oracle/instantclient_11_2

are you trying to do something with oracle's stuff? or is this unrelated?
 
BTW: gmpy2 is on conda-forge -- this should work:

$ conda install -c conda-forge gmpy2


:-)

-CHB




--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Mike Hagerty

unread,
Jul 25, 2016, 2:08:38 PM7/25/16
to Chris Barker, Paul Hobson, Eric Dill, conda - Public
Hi Chris,
thanks for the reply.  Yes, I wondered if conda install was just grabbing precompiled binaries ...
And thanks - Tom Lynch pointed me to gmpy2 on conda-forge and I installed it over the weekend.

In the long run, I need to get my env cleaned up so that pip install works with gcc.
I was doing a bunch of python wrapping of c libraries (for a noaa project coincidentally :) before
I stumbled upon anaconda/conda, so I don't know that I have the cleanest python - I mean the
anaconda dirs are totally clean, but there are multiple python libs/locations on my system.

Anyhow, thanks for the reply - time to read more about pip install, etc.

Cheers,
-Mike
Reply all
Reply to author
Forward
0 new messages