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

Virtualenv created with python 3 still installing in and using system python 2 #890

Closed
crdoconnor opened this issue Apr 16, 2016 · 4 comments

Comments

@crdoconnor
Copy link

crdoconnor commented Apr 16, 2016

This occurs on a Mac with a recently upgraded (with brew) python, python3 and a recently upgraded (with pip) virtualenv and pip::

virtualenv venv --python=python3
./venv/bin/pip install pyyaml
Requirement already satisfied (use --upgrade to upgrade): PyYAML in /Library/Python/2.7/site-packages

Note that it tried to update the system python2 PyYaml.

User:test user$ ./venv/bin/python
Python 3.5.1 (default, Apr 5 2016, 21:27:05)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

        import yaml
        Traceback (most recent call last):
        File "", line 1, in
        File "/Library/Python/2.7/site-packages/yaml/init.py", line 2, in
        from error import *
        ImportError: No module named 'error'

The python 3 code is trying to import python 2 from the system.

Is there anything that you know of that might be causing this python 2 / 3 crossover problem?

@hardkrash
Copy link

hardkrash commented Jun 16, 2016

Did you activate your virtual environment?

e.g.
source env/bin/activate

It would also be helpful to give the results of import sys; print(sys.path)

@Ivoz
Copy link

Ivoz commented Jun 20, 2016

@crdoconnor do you have any thing in PYTHONPATH env variable?

@mimischi
Copy link

The referenced issue above is resolved. It was some kind of weird thing with my local python installation. Solved it here hitchtest/hitch#28 (comment).
This issue can thus be closed now.

@pfmoore
Copy link
Member

pfmoore commented Jul 24, 2016

Thanks for letting us know,

@pfmoore pfmoore closed this as completed Jul 24, 2016
@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants