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 inside virtualenv broken on osx TravisCI w/ Python 2.7 #1577

Closed
nsoranzo opened this issue Feb 11, 2020 · 10 comments
Closed

pip inside virtualenv broken on osx TravisCI w/ Python 2.7 #1577

nsoranzo opened this issue Feb 11, 2020 · 10 comments

Comments

@nsoranzo
Copy link
Contributor

$ pip --version
Traceback (most recent call last):
  File "/Users/travis/build/nsoranzo/galaxy/.venv/bin/pip", line 6, in <module>
    from pip._internal.cli.main import main
ImportError: No module named main

python from the virtualenv seems to be using the pip module from /usr/local/lib/python2.7/site-packages/pip

See https://travis-ci.org/nsoranzo/galaxy/builds/648992164 for the exact sequence of command used.

@hugovk
Copy link
Contributor

hugovk commented Feb 11, 2020

See also #1576 for the same thing with 3.x-dev on Travis CI.

@gaborbernat
Copy link
Contributor

I'm fairly certain our release from yesterday may have broken CI environments that assumed that all virtual environment files are within the target folder. We're now making app-data copy by default, see #1578, this might fix most edge-cases; though mind you environments already broken at image level, as is @hugovk case will probably require some intervention from the CI operator level to fix.

@gaborbernat
Copy link
Contributor

This now has been fixed on our side, so I'll close the issue. Once we do the bugfix release I'll come back and post a message here.

@nsoranzo
Copy link
Contributor Author

@gaborbernat Thanks a lot for working on this! I've updated the Travis script to install virtualenv from the GitHub master branch, but I still see the same issue: https://travis-ci.org/nsoranzo/galaxy/builds/649034246

If the issue is at the CI image level, do you have suggestions for a workaround? Using python -m pip seems to be more stable than pip, for example.

@gaborbernat
Copy link
Contributor

I'll need to take a look to confirm, just released few minutes ago 20.0.2.

@gaborbernat gaborbernat reopened this Feb 11, 2020
@gaborbernat
Copy link
Contributor

Can you do a tree command on /Users/travis/build/nsoranzo/galaxy/.venv and report back?

@nsoranzo
Copy link
Contributor Author

Can you do a tree command on /Users/travis/build/nsoranzo/galaxy/.venv and report back?

Here it is: https://travis-ci.org/nsoranzo/galaxy/builds/649094823

@nsoranzo
Copy link
Contributor Author

Another weirdness I've discovered: with the venv activated, python -m pip install <package> installs the package inside /usr/local/lib/python2.7/site-packages/ instead of inside the venv , see https://travis-ci.org/nsoranzo/galaxy/builds/649733024

@gaborbernat
Copy link
Contributor

@nsoranzo that's #1561 Apple Framework Python 2 is weird.

@nsoranzo
Copy link
Contributor Author

Fixed by #1641, thanks @gaborbernat !

For reference, the successful Travis build where package are correctly installed inside the virtual env and pip works as expected: https://travis-ci.org/nsoranzo/galaxy/builds/653525565

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants