Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install not working #823

Closed
jiffyclub opened this issue Jul 22, 2014 · 25 comments
Closed

pip install not working #823

jiffyclub opened this issue Jul 22, 2014 · 25 comments
Labels
locked [bot] locked due to inactivity

Comments

@jiffyclub
Copy link

I make a new environment with pip and setuptools then try to install something trivial and it fails with the message setuptools must be installed to install from a source distribution. I've lately had to bootstrap install setuptools and pip every time I want to use pip.

~ > conda create -n py27 python=2.7 pip setuptools
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /Users/jiffyclub/miniconda3/envs/py27:

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.0.1h             |                0   hard-link
    pip-1.5.6                  |           py27_0   hard-link
    python-2.7.8               |                0   hard-link
    readline-6.2               |                2   hard-link
    setuptools-3.6             |           py27_0   hard-link
    sqlite-3.8.4.1             |                0   hard-link
    tk-8.5.15                  |                0   hard-link
    zlib-1.2.7                 |                1   hard-link

Proceed ([y]/n)?

Linking packages ...
[      COMPLETE      ] |###############################################################################################| 100%
#
# To activate this environment, use:
# $ source activate py27
#
# To deactivate this environment, use:
# $ source deactivate
#
~ > condactivate py27
(py27) ~ > pip install brewer2mpl
Downloading/unpacking brewer2mpl
  Downloading brewer2mpl-1.4.tar.gz
  Storing download in cache at ./Library/Caches/pip-downloads/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fb%2Fbrewer2mpl%2Fbrewer2mpl-1.4.tar.gz
Cleaning up...
setuptools must be installed to install from a source distribution
Storing debug log for failure in /Users/jiffyclub/.pip/pip.log
@tpn
Copy link
Contributor

tpn commented Jul 22, 2014

This worked for me:

(trent@raptor:ttys010) (Tue/16:24) ..                                           (~s/khmer)
% conda create -n b2 python=2.7 pip
Fetching package metadata: ......
Solving package specifications: .
Package plan for installation in environment /Users/Trent/anaconda/envs/b2:

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.0.1h             |                0   hard-link
    pip-1.5.6                  |           py27_0   hard-link
    python-2.7.8               |                0   hard-link
    readline-6.2               |                2   hard-link
    setuptools-3.6             |           py27_0   hard-link
    sqlite-3.8.4.1             |                0   hard-link
    tk-8.5.15                  |                0   hard-link
    zlib-1.2.7                 |                1   hard-link

Proceed ([y]/n)? y

Linking packages ...
[      COMPLETE      ] |#############################################################| 100%
#
# To activate this environment, use:
# $ source activate b2
#
# To deactivate this environment, use:
# $ source deactivate
#
(trent@raptor:ttys010) (Tue/16:24) ..                                           (~s/khmer)
% source activate b2
discarding /Users/Trent/anaconda/bin from PATH
prepending /Users/Trent/anaconda/envs/b2/bin to PATH
(b2)(trent@raptor:ttys010) (Tue/16:24) ..                                       (~s/khmer)
% pip install brewer2mpl
Downloading/unpacking brewer2mpl
  Downloading brewer2mpl-1.4.tar.gz
  Running setup.py (path:/private/var/folders/7t/jhrygn4x5fz8hmf974g129w00000gn/T/pip_build_Trent/brewer2mpl/setup.py) egg_info for package brewer2mpl

Installing collected packages: brewer2mpl
  Running setup.py install for brewer2mpl

Successfully installed brewer2mpl
Cleaning up...
(b2)(trent@raptor:ttys010) (Tue/16:25) ..                                       (~s/khmer)
% 

@jiffyclub
Copy link
Author

Nope, same problem for me:

~ > conda create -n py27 python=2.7 pip
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /Users/jiffyclub/miniconda3/envs/py27:

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.0.1h             |                0   hard-link
    pip-1.5.6                  |           py27_0   hard-link
    python-2.7.8               |                0   hard-link
    readline-6.2               |                2   hard-link
    setuptools-3.6             |           py27_0   hard-link
    sqlite-3.8.4.1             |                0   hard-link
    tk-8.5.15                  |                0   hard-link
    zlib-1.2.7                 |                1   hard-link

Proceed ([y]/n)?

Linking packages ...
[      COMPLETE      ] |##################################################| 100%
#
# To activate this environment, use:
# $ source activate py27
#
# To deactivate this environment, use:
# $ source deactivate
#
~ > condactivate py27
(py27) ~ > type pip
pip is /Users/jiffyclub/miniconda3/envs/py27/bin/pip
(py27) ~ > pip install brewer2mpl
Downloading/unpacking brewer2mpl
  Using download cache from /Users/jiffyclub/Library/Caches/pip-downloads/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fb%2Fbrewer2mpl%2Fbrewer2mpl-1.4.tar.gz
Cleaning up...
setuptools must be installed to install from a source distribution
Storing debug log for failure in /Users/jiffyclub/.pip/pip.log

@aterrel
Copy link
Contributor

aterrel commented Jul 22, 2014

I assume condactivate is source activate.

First try doing conda update conda

Then if that fails send in what conda info says.

@jiffyclub
Copy link
Author

~ > conda update conda
Fetching package metadata: ..
# All requested packages already installed.
# packages in environment at /Users/jiffyclub/miniconda3:
#
conda                     3.5.5                    py34_0
~ > conda info
Current conda install:

             platform : osx-64
        conda version : 3.5.5
       python version : 3.4.1.final.0
     root environment : /Users/jiffyclub/miniconda3  (writable)
  default environment : /Users/jiffyclub/miniconda3
     envs directories : /Users/jiffyclub/miniconda3/envs
        package cache : /Users/jiffyclub/miniconda3/pkgs
         channel URLs : http://repo.continuum.io/pkgs/free/osx-64/
                        http://repo.continuum.io/pkgs/pro/osx-64/
          config file : None
    is foreign system : False

~ >

@aterrel
Copy link
Contributor

aterrel commented Jul 22, 2014

hmm I'm using the python 2.7 one. let me check the 3.4 version.

@aterrel
Copy link
Contributor

aterrel commented Jul 22, 2014

Everything works for me with a fresh install of miniconda v 3.4.

Can you move your ~/.pip to ~/.pip_bk and remove the cached download:

rm /Users/jiffyclub/Library/Caches/pip-downloads/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fb%2Fbrewer2mpl%2Fbrewer2mpl-1.4.tar.gz

@jiffyclub
Copy link
Author

This is the crux of the problem, I think:

~ > conda create -n py27 python=2.7 setuptools
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment /Users/jiffyclub/miniconda3/envs/py27:

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.0.1h             |                0   hard-link
    python-2.7.8               |                0   hard-link
    readline-6.2               |                2   hard-link
    setuptools-3.6             |           py27_0   hard-link
    sqlite-3.8.4.1             |                0   hard-link
    tk-8.5.15                  |                0   hard-link
    zlib-1.2.7                 |                1   hard-link

Proceed ([y]/n)?

Linking packages ...
[      COMPLETE      ] |###############################################################################################| 100%
#
# To activate this environment, use:
# $ source activate py27
#
# To deactivate this environment, use:
# $ source deactivate
#
~ > condactivate py27
(py27) ~ > python -c 'import setuptools'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named setuptools

It works fine if I do the same thing but in a python 3.4 environment instead of python 2.7.

@aterrel
Copy link
Contributor

aterrel commented Jul 23, 2014

It seems that you are not linking to the right python. I don't know why this is, but when I call source activate foo I usually see:

discarding <path to old foo> from PATH
prepending <path to new foo> to PATH

Maybe @asmeurer has some ideas

@jiffyclub
Copy link
Author

I don't use bash, so I don't use activate. I had to hack my own solution
together.

But why does pip work in Python 3 but not 2?

On Tuesday, July 22, 2014, Andy R. Terrel notifications@github.com wrote:

It seems that you are not linking to the right python. I don't know why
this is, but when I call source activate foo I usually see:

discarding from PATH
prepending to PATH

Maybe @asmeurer https://github.com/asmeurer has some ideas


Reply to this email directly or view it on GitHub
#823 (comment).

@jiffyclub
Copy link
Author

More info: I use the fish shell.

This has only started happening recently and I can't think of a change that
would cause it. I guess I can blow away my miniconda install and start
over, see if that helps.

On Tuesday, July 22, 2014, Andy R. Terrel notifications@github.com wrote:

It seems that you are not linking to the right python. I don't know why
this is, but when I call source activate foo I usually see:

discarding from PATH
prepending to PATH

Maybe @asmeurer https://github.com/asmeurer has some ideas


Reply to this email directly or view it on GitHub
#823 (comment).

@aterrel
Copy link
Contributor

aterrel commented Jul 23, 2014

Okay looks like fish isn't the problem...

aterrel@tulip ~> conda create -n py27 python=2.7 setuptools
Fetching package metadata: ...
Solving package specifications: .
Package plan for installation in environment /Users/aterrel/workspace/apps/anaconda/miniconda-3.5.5-py34/envs/py27:

The following packages will be linked:

    package                    |            build
    ---------------------------|-----------------
    openssl-1.0.1h             |                0   hard-link
    python-2.7.8               |                0   hard-link
    readline-6.2               |                2   hard-link
    setuptools-3.6             |           py27_0   hard-link
    sqlite-3.8.4.1             |                0   hard-link
    tk-8.5.15                  |                0   hard-link
    zlib-1.2.7                 |                1   hard-link

Proceed ([y]/n)? 

Linking packages ...
[      COMPLETE      ] |##############################################################################################################################################################################| 100%
#
# To activate this environment, use:
# $ source activate py27
#
# To deactivate this environment, use:
# $ source deactivate
#
aterrel@tulip ~> set -x PATH /Users/aterrel/workspace/apps/anaconda/miniconda-3.5.5-py34/envs/py27/bin/ $PATH
aterrel@tulip ~> python
Python 2.7.8 |Continuum Analytics, Inc.| (default, Jul  2 2014, 15:36:00) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import setuptools
>>> 
aterrel@tulip ~> ls (dirname (which python))/../lib/python2.7/site-packages
README                   setuptools-3.6-py2.7.egg setuptools.pth

@jiffyclub
Copy link
Author

My setup looks the same:

(py27) ~ > ls (dirname (which python))/../lib/python2.7/site-packages
README                   setuptools-3.6-py2.7.egg setuptools.pth

Like I said, it used to work fine and then it stopped. If I bootstrap install pip (wget https://bootstrap.pypa.io/get-pip.py -O - | python) things continue to work fine.

I guess we can chalk this up to some oddity of my system, I'll let you know if I ever find out what's going on.

@asmeurer
Copy link
Contributor

Can you show conda info -a?

You can see that it is installing setuptools when it installs pip.

@jiffyclub
Copy link
Author

This is the output of conda info -a when I'm in the py27 environment that demonstrates this problem:

(py27) ~ > conda info -a
Current conda install:

             platform : osx-64
        conda version : 3.5.5
       python version : 3.4.1.final.0
     root environment : /Users/jiffyclub/miniconda3  (writable)
  default environment : /Users/jiffyclub/miniconda3/envs/py27
     envs directories : /Users/jiffyclub/miniconda3/envs
        package cache : /Users/jiffyclub/miniconda3/pkgs
         channel URLs : http://repo.continuum.io/pkgs/free/osx-64/
                        http://repo.continuum.io/pkgs/pro/osx-64/
          config file : None
    is foreign system : False

# conda environments:
#
admintool                /Users/jiffyclub/miniconda3/envs/admintool
geopandas                /Users/jiffyclub/miniconda3/envs/geopandas
ipborg                   /Users/jiffyclub/miniconda3/envs/ipborg
opus                     /Users/jiffyclub/miniconda3/envs/opus
patsy-dev                /Users/jiffyclub/miniconda3/envs/patsy-dev
pil                      /Users/jiffyclub/miniconda3/envs/pil
popgen                   /Users/jiffyclub/miniconda3/envs/popgen
py27                  *  /Users/jiffyclub/miniconda3/envs/py27
py34                     /Users/jiffyclub/miniconda3/envs/py34
swc                      /Users/jiffyclub/miniconda3/envs/swc
urbansim                 /Users/jiffyclub/miniconda3/envs/urbansim
root                     /Users/jiffyclub/miniconda3

sys.version: 3.4.1 |Continuum Analytics, Inc.| (defau...
sys.prefix: /Users/jiffyclub/miniconda3
sys.executable: /Users/jiffyclub/miniconda3/bin/python3
conda location: /Users/jiffyclub/miniconda3/lib/python3.4/site-packages/conda
conda-build: None

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: py27
CONDA_ENVS_PATH: <not set>
DYLD_LIBRARY_PATH: <not set>
PATH: /Users/jiffyclub/miniconda3/envs/py27/bin:/Users/jiffyclub/bin:/Users/jiffyclub/Dropbox/synthbin:/Users/jiffyclub/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/ruby/bin
PYTHONHOME: <not set>
PYTHONPATH: <not set>

WARNING: could import _license.show_info
# try:
# $ conda install -n root _license

@jiffyclub
Copy link
Author

Out of curiosity, is there a reason conda uses setuptools 3.6 instead of the most recent 5.4.1?

@asmeurer
Copy link
Contributor

I guess we haven't updated it in a while. @ilanschnell

@asmeurer
Copy link
Contributor

Try conda install -f setuptools in that environment.

@jiffyclub
Copy link
Author

Is there a place we can contribute updated recipes for core conda use the way you can with Homebrew? E.g. pytest is out of date too, but I hate pestering you all every time this happens. Is that what conda/conda-recipes is for?

@asmeurer
Copy link
Contributor

At this point, no, we use a separate internal repo for the recipes for our official packages.

@jiffyclub
Copy link
Author

I ran conda install -f setuptools and now pip works even after I destroy an environment and recreate it. (I accidentally ran conda install -f setuptools in my root environment too, dunno if that could be having an influence somehow.) Weirdness.

@asmeurer
Copy link
Contributor

Conda works by unpacking the packages in the pkgs directory and then hard linking them to the environment. Sometimes these get corrupted somehow, breaking all environments that use them, and also any additional environments, since the same files are hard linked each time. conda install -f unarchives the package again. Note that this breaks the links to any other environments that already had setuptools installed, so you'll have to reinstall it there too (it also means that running conda install -f a lot can use up a lot of disk space if you have a lot of environments).

Doing so in your root environment wouldn't affect it because the Python 3 version of setuptools is a separate package. An even if it were the same package it wouldn't because it would just break the link.

@jiffyclub
Copy link
Author

Ah, thanks for the explanation.

@aterrel
Copy link
Contributor

aterrel commented Jul 29, 2014

That's one for an FAQ.
On Jul 28, 2014 5:07 PM, "Aaron Meurer" notifications@github.com wrote:

Conda works by unpacking the packages in the pkgs directory and then hard
linking them to the environment. Sometimes these get corrupted somehow,
breaking all environments that use them, and also any additional
environments, since the same files are hard linked each time. conda
install -f unarchives the package again. Note that this breaks the links
to any other environments that already had setuptools installed, so you'll
have to reinstall it there too (it also means that running conda install -f
a lot can use up a lot of disk space if you have a lot of environments).

Doing so in your root environment wouldn't affect it because the Python 3
version of setuptools is a separate package. An even if it were the same
package it wouldn't because it would just break the link.


Reply to this email directly or view it on GitHub
#823 (comment).

@asmeurer
Copy link
Contributor

asmeurer commented Aug 1, 2014

@github-actions
Copy link

github-actions bot commented Dec 4, 2021

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Dec 4, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants