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

conda update anaconda breaks pip user install #4807

Closed
justbennet opened this issue Mar 5, 2017 · 8 comments
Closed

conda update anaconda breaks pip user install #4807

justbennet opened this issue Mar 5, 2017 · 8 comments
Labels
locked [bot] locked due to inactivity

Comments

@justbennet
Copy link

justbennet commented Mar 5, 2017

Per ijstokes@continuum.io, reposting here from Anaconda Google group.

After running conda update anaconda on an Ubuntu 16.04 machine, pip seems to be broken for user installs.

bennet@skills:~$ pip install mriqc --user
Traceback (most recent call last):
  File "/usr/local/anaconda2-4.0.0/bin/pip", line 6, in <module>
    sys.exit(pip.main())
  File "/usr/local/anaconda2-4.0.0/lib/python2.7/site-packages/pip/__init__.py", line 239, in main
    ensure_easy_pth()
  File "/usr/local/anaconda2-4.0.0/lib/python2.7/site-packages/pip/__init__.py", line 217, in ensure_easy_pth
    with open(path, 'w') as fo:
IOError: [Errno 13] Permission denied: '/usr/local/anaconda2-4.0.0/lib/python2.7/site-packages/easy-install.pth

I believe this should work, as it did prior to the update.

Anyone have an idea why it wants to write to the central directory for a user installation?

I reinstalled from a saved Anaconda installer. After installation, but before update, pip install mriqc --user starts downloading with no errors. After running conda update anaconda again, I get the same error as in the original post.

Both installation and update are run as root. The pip command is being issued by an unprivileged user in both working and non-working cases.

This is the header information from my installer:

#!/bin/bash
# Copyright (c) 2012-2016 Continuum Analytics, Inc.
# All rights reserved.
#
# NAME:  Anaconda2
# VER:   4.0.0
# PLAT:  linux-64
# DESCR: 2.5.0-752-g796614d
# BYTES: 411562823
# LINES: 532
# MD5:   5fd3404acd5b0415eace3d11e2e34129

in case that matters or helps.

Thanks, -- bennet

@nehaljwani
Copy link
Contributor

@justbennet What happens when you do:

$ /usr/local/anaconda2-4.0.0/bin/conda create -n condatest
$ /usr/local/anaconda2-4.0.0/bin/source activate condatest
$ pip install mriqc --user

@justbennet
Copy link
Author

Wouldn't creating a virtual environment obviate needing to use pip ... --user? It does finesse the issue, but we're trying to show people how to set things up in a generic python environment and not an Anaconda-specific one. Nonetheless, since you asked, I did a fresh installation, ran conda update anaconda, set the path to reference the new installation, and

bennet@skills:~$ conda create -n test
Fetching package metadata .........
Solving package specifications: 
Package plan for installation in environment /home/bennet/.conda/envs/test:

Proceed ([y]/n)? y

#
# To activate this environment, use:
# > source activate test
#
# To deactivate this environment, use:
# > source deactivate test
#

bennet@skills:~$ source activate test
(test) bennet@skills:~$ which python
/tmp/anaconda/bin/python
(test) bennet@skills:~$ which conda
/home/bennet/.conda/envs/test/bin/conda
(test) bennet@skills:~$ which pip
/tmp/anaconda/bin/pip
(test) bennet@skills:~$ pip install mriqc --user
Traceback (most recent call last):
  File "/tmp/anaconda/bin/pip", line 6, in <module>
    sys.exit(pip.main())
  File "/tmp/anaconda/lib/python2.7/site-packages/pip/__init__.py", line 239, in main
    ensure_easy_pth()
  File "/tmp/anaconda/lib/python2.7/site-packages/pip/__init__.py", line 217, in ensure_easy_pth
    with open(path, 'w') as fo:
IOError: [Errno 13] Permission denied: '/tmp/anaconda/lib/python2.7/site-packages/easy-install.pth'

I think that there is something incorrect in the setup of pip that conda delivers, since it seemed to work in prior Anaconda installations and it seems to work fine using the system-provided pip.

My report was to inform Continuum that something might be amiss in the build of pip being distributed. We can find ways to finesse the situation, but it seems like it could be a problem that they might wish to fix.

@nehaljwani
Copy link
Contributor

@justbennet Could you please repeat the same steps, which a small change (install pip while creating the test environment, so that you don't use pip from the root environment):

$ conda create -n condatest pip
$ source activate condatest
$ which pip
$ pip install mriqc --user

@justbennet
Copy link
Author

Of course that works.

It replaces the broken pip that tries to access a folder to which I don't have permission with one that tries to access a folder that I own.

I don't see how that provides any useful information whatsoever as to the brokenness or not of the centrally installed pip. I didn't think there was anything in pip itself that prevented use by people other than the installer. Perhaps I should check that assumption.

I will repeat: I have plenty of workarounds. This is just reporting in good faith what I consider to be a misconfiguration of pip by Anaconda. If the Anaconda/conda/pip maintainers disagree, then they can close the issue.

We will use something other than Anaconda, which I've already been told in the google group is intended for personal use and not meant to be centrally installed and maintained, and is therefore probably inappropriate for our use case. I accept that.

@wfdoran
Copy link

wfdoran commented Mar 28, 2017

We are having the same issue with Anaconda2 4.3. This used to work and still works with Anaconda3.

@kalefranz
Copy link
Contributor

My report was to inform Continuum that something might be amiss in the build of pip being distributed. We can find ways to finesse the situation, but it seems like it could be a problem that they might wish to fix.

I don't think there's anything that changing conda's own code can fix here.

@kalefranz
Copy link
Contributor

This issue was moved to ContinuumIO/anaconda-issues#1668

@github-actions
Copy link

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 Oct 21, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 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