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

PyPy 3.6 running in macOS Python 3 virtualenv installs pip in wrong location #1654

Closed
YannickJadoul opened this issue Feb 22, 2020 · 11 comments

Comments

@YannickJadoul
Copy link
Member

YannickJadoul commented Feb 22, 2020

Using get-pip.py to install pip in a PyPy 3.6 v7.3.0 installation from within pytest running in a macOS Python 3 virtualenv fails to install pip in the expected location (pypy3.6-v7.3.0-osx64/bin/pip), but instead installs it in the outer Python 3 virtualenv.

The following script manages to reproduce this on a mac I have access to.

mkdir tmp_dir
cd tmp_dir

curl -L https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.3.0-osx64.tar.bz2 | tar xj
curl -L https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v7.3.0-osx64.tar.bz2 | tar xj
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

python3 -m virtualenv --version
python3 -m virtualenv env
source env/bin/activate

pip install pytest

cat << EOF > test.py
import os
import subprocess

def test2():
    subprocess.check_call(['pypy2.7-v7.3.0-osx64/bin/pypy', 'get-pip.py', '-v'])
    subprocess.check_call(['pypy2.7-v7.3.0-osx64/bin/pypy', '-m', 'site'])
    print(os.listdir('pypy2.7-v7.3.0-osx64/bin'))
    assert False

def test3():
    subprocess.check_call(['pypy3.6-v7.3.0-osx64/bin/pypy3', 'get-pip.py', '-v'])
    subprocess.check_call(['pypy3.6-v7.3.0-osx64/bin/pypy3', '-m', 'site'])
    print(os.listdir('pypy3.6-v7.3.0-osx64/bin'))
    assert False

EOF

pytest test.py
Output

ai31:~ yannick$ ./minimal_example.sh 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 20.5M  100 20.5M    0     0  1263k      0  0:00:16  0:00:16 --:--:-- 1707k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 20.2M  100 20.2M    0     0  1406k      0  0:00:14  0:00:14 --:--:-- 1607k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1764k  100 1764k    0     0  6561k      0 --:--:-- --:--:-- --:--:-- 6561k
virtualenv 20.0.5 from /usr/local/lib/python3.7/site-packages/virtualenv/__init__.py
created virtual environment CPython3.7.5.final.0-64 in 199ms
  creator CPython3Posix(dest=/Users/yannick/tmp_dir/env, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/yannick/Library/Application Support/virtualenv/seed-v1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
Collecting pytest
  Using cached pytest-5.3.5-py3-none-any.whl (235 kB)
Collecting packaging
  Using cached packaging-20.1-py2.py3-none-any.whl (36 kB)
Collecting importlib-metadata>=0.12; python_version < "3.8"
  Using cached importlib_metadata-1.5.0-py2.py3-none-any.whl (30 kB)
Collecting more-itertools>=4.0.0
  Using cached more_itertools-8.2.0-py3-none-any.whl (43 kB)
Collecting py>=1.5.0
  Using cached py-1.8.1-py2.py3-none-any.whl (83 kB)
Collecting pluggy<1.0,>=0.12
  Using cached pluggy-0.13.1-py2.py3-none-any.whl (18 kB)
Collecting attrs>=17.4.0
  Using cached attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Collecting wcwidth
  Using cached wcwidth-0.1.8-py2.py3-none-any.whl (17 kB)
Collecting pyparsing>=2.0.2
  Using cached pyparsing-2.4.6-py2.py3-none-any.whl (67 kB)
Collecting six
  Using cached six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting zipp>=0.5
  Using cached zipp-3.0.0-py3-none-any.whl (4.8 kB)
Installing collected packages: pyparsing, six, packaging, zipp, importlib-metadata, more-itertools, py, pluggy, attrs, wcwidth, pytest
Successfully installed attrs-19.3.0 importlib-metadata-1.5.0 more-itertools-8.2.0 packaging-20.1 pluggy-0.13.1 py-1.8.1 pyparsing-2.4.6 pytest-5.3.5 six-1.14.0 wcwidth-0.1.8 zipp-3.0.0
======================================== test session starts ========================================
platform darwin -- Python 3.7.5, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /Users/yannick/tmp_dir
collected 2 items                                                                                   

test.py FF                                                                                    [100%]

============================================= FAILURES ==============================================
_______________________________________________ test2 _______________________________________________

    def test2():
        subprocess.check_call(['pypy2.7-v7.3.0-osx64/bin/pypy', 'get-pip.py', '-v'])
        subprocess.check_call(['pypy2.7-v7.3.0-osx64/bin/pypy', '-m', 'site'])
        print(os.listdir('pypy2.7-v7.3.0-osx64/bin'))
>       assert False
E       assert False

test.py:8: AssertionError
--------------------------------------- Captured stdout call ----------------------------------------
Non-user install because site-packages writeable
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-ephem-wheel-cache-Dzm69W
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-4kc17d
Initialized build tracking at /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-4kc17d
Created build tracker: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-4kc17d
Entered build tracker: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-4kc17d
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-install-yhafaR
1 location(s) to search for versions of pip:
* https://pypi.org/simple/pip/
Fetching project page and analyzing links: https://pypi.org/simple/pip/
Getting page https://pypi.org/simple/pip/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/pip/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/pip/ HTTP/1.1" 304 0
  Found link https://files.pythonhosted.org/packages/3d/9d/1e313763bdfb6a48977b65829c6ce2a43eaae29ea2f907c8bbef024a7219/pip-0.2.tar.gz#sha256=88bb8d029e1bf4acd0e04d300104b7440086f94cc1ce1c5c3c31e3293aee1f81 (from https://pypi.org/simple/pip/), version: 0.2

...

Installing collected packages: pip, setuptools, wheel
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-xnir60

  changing mode of /Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/bin/pip to 755
  changing mode of /Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/bin/pip2 to 755
  changing mode of /Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/bin/pip2.7 to 755
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-qGsleO

  changing mode of /Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/bin/easy_install to 755
  changing mode of /Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/bin/easy_install-2.7 to 755
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-erEv1A

  changing mode of /Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/bin/wheel to 755
Successfully installed pip-20.0.2 setuptools-44.0.0 wheel-0.34.2
Cleaning up...
Removed build tracker: '/private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-4kc17d'
sys.path = [
    '/Users/yannick/tmp_dir',
    '/Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/lib_pypy/__extensions__',
    '/Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/lib_pypy',
    '/Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/lib-python/2.7',
    '/Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/lib-python/2.7/lib-tk',
    '/Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/lib-python/2.7/plat-darwin',
    '/Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/lib-python/2.7/plat-mac',
    '/Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/lib-python/2.7/plat-mac/lib-scriptpackages',
    '/Users/yannick/tmp_dir/pypy2.7-v7.3.0-osx64/site-packages',
]
USER_BASE: '/Users/yannick/.local' (doesn't exist)
USER_SITE: '/Users/yannick/.local/lib/pypy2.7/site-packages' (doesn't exist)
ENABLE_USER_SITE: True
['libpypy-c.dylib', 'pip2', 'easy_install', 'wheel', 'pip', 'pypy', 'easy_install-2.7', 'pip2.7']
--------------------------------------- Captured stderr call ----------------------------------------
DEPRECATION: A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
_______________________________________________ test3 _______________________________________________

    def test3():
        subprocess.check_call(['pypy3.6-v7.3.0-osx64/bin/pypy3', 'get-pip.py', '-v'])
        subprocess.check_call(['pypy3.6-v7.3.0-osx64/bin/pypy3', '-m', 'site'])
        print(os.listdir('pypy3.6-v7.3.0-osx64/bin'))
>       assert False
E       assert False

test.py:14: AssertionError
--------------------------------------- Captured stdout call ----------------------------------------
Non-user install because user site-packages disabled
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-ephem-wheel-cache-p_j2cq6p
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-na7rsa2b
Initialized build tracking at /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-na7rsa2b
Created build tracker: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-na7rsa2b
Entered build tracker: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-na7rsa2b
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-install-08qoikav
1 location(s) to search for versions of pip:
* https://pypi.org/simple/pip/
Fetching project page and analyzing links: https://pypi.org/simple/pip/
Getting page https://pypi.org/simple/pip/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/pip/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/pip/ HTTP/1.1" 304 0
  Found link https://files.pythonhosted.org/packages/3d/9d/1e313763bdfb6a48977b65829c6ce2a43eaae29ea2f907c8bbef024a7219/pip-0.2.tar.gz#sha256=88bb8d029e1bf4acd0e04d300104b7440086f94cc1ce1c5c3c31e3293aee1f81 (from https://pypi.org/simple/pip/), version: 0.2

...

Installing collected packages: pip, setuptools, wheel
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-_wruh4x9

  changing mode of /Users/yannick/tmp_dir/env/bin/pip to 755
  changing mode of /Users/yannick/tmp_dir/env/bin/pip3 to 755
  changing mode of /Users/yannick/tmp_dir/env/bin/pip3.6 to 755
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-15knx9f1

  changing mode of /Users/yannick/tmp_dir/env/bin/easy_install to 755
  changing mode of /Users/yannick/tmp_dir/env/bin/easy_install-3.6 to 755
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-n8_gcseu

  changing mode of /Users/yannick/tmp_dir/env/bin/wheel to 755
Successfully installed pip-20.0.2 setuptools-45.2.0 wheel-0.34.2
Cleaning up...
Removed build tracker: '/private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-na7rsa2b'
sys.path = [
    '/Users/yannick/tmp_dir',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy/__extensions__',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/lib-tk',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-darwin',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac/lib-scriptpackages',
    '/Users/yannick/tmp_dir/env/site-packages',
]
USER_BASE: '/Users/yannick/.local' (doesn't exist)
USER_SITE: '/Users/yannick/.local/lib/pypy3.6/site-packages' (doesn't exist)
ENABLE_USER_SITE: False
['libpypy3-c.dylib', 'pypy3']
======================================== 2 failed in 23.66s =========================================

I think the main thing to notice in that whole output, is that when running PyPy 3.6, v7.3.0 from within pytest from within a virtualenv, -m site gives this output:

sys.path = [
    '/Users/yannick/tmp_dir',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy/__extensions__',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/lib-tk',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-darwin',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac/lib-scriptpackages',
    '/Users/yannick/tmp_dir/env/site-packages',
]
USER_BASE: '/Users/yannick/.local' (doesn't exist)
USER_SITE: '/Users/yannick/.local/lib/pypy3.6/site-packages' (doesn't exist)
ENABLE_USER_SITE: False

while if I afterwards run the same command outside of pytest, I get:

ai31:~ yannick$ cd tmp_dir/
ai31:tmp_dir yannick$ source env/bin/activate
(env) ai31:tmp_dir yannick$ pypy3.6-v7.3.0-osx64/bin/pypy3 -m site
sys.path = [
    '/Users/yannick/tmp_dir',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy/__extensions__',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/lib-tk',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-darwin',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac/lib-scriptpackages',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/site-packages',
]
USER_BASE: '/Users/yannick/.local' (doesn't exist)
USER_SITE: '/Users/yannick/.local/lib/pypy3.6/site-packages' (doesn't exist)
ENABLE_USER_SITE: True

Things to note:

  • PyPy 2.7 works, PyPy 3.6 not
  • virtualenv 19 works, virtualenv 20 not
  • Directly running get-pip.py works, running through pytest not

I have not yet tried (but will, now):

  • Whether this also fails on Linux.
  • Whether this also fails in a Python 2 virtualenv on macOS.
  • Whether this also fails when installing a different script than pip with get-pip.py.

I'll tell the PyPy people on IRC, as well.

PS: I'm really sorry for finding such a nasty bug :-/ This seems horrible to debug.

EDIT: First noticed in the context of pypa/cibuildwheel#274 and #1561.

@YannickJadoul
Copy link
Member Author

Oh, worth noticing: is this maybe linked to #1652? That issue is about site as well, but for PyPy 2.7, so it's not clear.

@gaborbernat
Copy link
Contributor

Did you try to see if using the venv instead of virtualenv gives you the same behaviour?

@gaborbernat
Copy link
Contributor

We don't patch site.py for Python 3 so the issue is not related.

@YannickJadoul
Copy link
Member Author

OK, will try that as well!

I've also just noticed I ran python -v get-pip.py instead of python get-pip.py -v. I've changed the output of the command, above!

@YannickJadoul
Copy link
Member Author

Tried out some more things:

  • The same works on Linux; pip gets installed in the right location. pypy3 -m site is the same inside of a pytest test as outside of it.
  • The same for Python 2 on macOS: this works, and site is correct, so it's linked to Python 3 on macOS.
  • Using ensurepip instead of get-pip.py also fails; pip is installed in the wrong location, in the CPython 3 virtualenv, rather than PyPy's bin directory.
  • Installing pip outside of the pytest test installs pip in the right pypy directory, but using it to install another Python package with script (e.g., cibuildwheel) fails, as this installed pip cannot be found (pypy3 -m site does not show /Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/site-packages to be in sys.path, but suddenly /Users/yannick/tmp_dir/env/site-packages is not in sys.path anymore, either!?)
  • Creating an outer environment with venv instead of virtualenv seems to result in the exact same error. Does this mean virtualenv is not to blame, but PyPy/pytest is to blame? But if so, isn't it weird that virtualenv 19 does work?

@gaborbernat
Copy link
Contributor

@YannickJadoul if that's the case please open an issue at https://foss.heptapod.net/pypy/pypy/issues; the problem is upstream not within virtualenv.

@YannickJadoul
Copy link
Member Author

OK, even weirder: running pypy3 -m site gives different output before and after installing pip from within the pytest test:

__________________________________________________________________________________________________ test3 ___________________________________________________________________________________________________

    def test3():
        subprocess.check_call(['pypy3.6-v7.3.0-osx64/bin/pypy3', '-m', 'site'])
        subprocess.check_call(['pypy3.6-v7.3.0-osx64/bin/pypy3', 'get-pip.py', '-v'])
        subprocess.check_call(['pypy3.6-v7.3.0-osx64/bin/pypy3', '-m', 'site'])
        print(os.listdir('pypy3.6-v7.3.0-osx64/bin'))
>       assert False
E       assert False

test.py:16: AssertionError
------------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------------
sys.path = [
    '/Users/yannick/tmp_dir',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy/__extensions__',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/lib-tk',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-darwin',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac/lib-scriptpackages',
]
USER_BASE: '/Users/yannick/.local' (doesn't exist)
USER_SITE: '/Users/yannick/.local/lib/pypy3.6/site-packages' (doesn't exist)
ENABLE_USER_SITE: False
Non-user install because user site-packages disabled
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-ephem-wheel-cache-vwu_ubeu
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-jj9dp_dx
Initialized build tracking at /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-jj9dp_dx
Created build tracker: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-jj9dp_dx
Entered build tracker: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-jj9dp_dx
Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-install-u17ynhi3
1 location(s) to search for versions of pip:
* https://pypi.org/simple/pip/

...

Installing collected packages: pip, setuptools, wheel
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-4kjplq6a

  changing mode of /Users/yannick/tmp_dir/env/bin/pip to 755
  changing mode of /Users/yannick/tmp_dir/env/bin/pip3 to 755
  changing mode of /Users/yannick/tmp_dir/env/bin/pip3.6 to 755
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-0z74l1dg

  changing mode of /Users/yannick/tmp_dir/env/bin/easy_install to 755
  changing mode of /Users/yannick/tmp_dir/env/bin/easy_install-3.6 to 755
  Created temporary directory: /private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-unpacked-wheel-r4t2ap_h

  changing mode of /Users/yannick/tmp_dir/env/bin/wheel to 755
Successfully installed pip-20.0.2 setuptools-45.2.0 wheel-0.34.2
Cleaning up...
Removed build tracker: '/private/var/folders/2k/7lc28xfj6vbfpyjpphcvyh7w0000gn/T/pip-req-tracker-jj9dp_dx'
sys.path = [
    '/Users/yannick/tmp_dir',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy/__extensions__',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib_pypy',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/lib-tk',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-darwin',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac',
    '/Users/yannick/tmp_dir/pypy3.6-v7.3.0-osx64/lib-python/3/plat-mac/lib-scriptpackages',
    '/Users/yannick/tmp_dir/env/site-packages',
]
USER_BASE: '/Users/yannick/.local' (doesn't exist)
USER_SITE: '/Users/yannick/.local/lib/pypy3.6/site-packages' (doesn't exist)
ENABLE_USER_SITE: False
['libpypy3-c.dylib', 'pypy3']

@YannickJadoul
Copy link
Member Author

@YannickJadoul if that's the case please open an issue at https://foss.heptapod.net/pypy/pypy/issues; the problem is upstream not within virtualenv.

OK, will do. Sorry for the inconvenience! :-/

@gaborbernat
Copy link
Contributor

gaborbernat commented Feb 22, 2020

Pre virtualenv 20 we used the python 2 methodologies to create virtual environments, even on python 3; which worked but caused a lot of maintainability issues and was more of a hack rather than a clean supported implementation. With virtualenv 20 we're using the same methodology as upstream does; and as described in https://www.python.org/dev/peps/pep-0405/. This explains why things worked with older virtual environments. Please link here the upstream issue once you open it so people running into the same can find it. Thanks!

PS. If upstream detect the issue and is something that can be fixed within virtualenv, please make a comment here and we'll reopen the issue and make it happen.

@YannickJadoul
Copy link
Member Author

Thanks, @gaborbernat! That makes sense indeed :-)

Issue reported here: https://foss.heptapod.net/pypy/pypy/issues/3175

@YannickJadoul
Copy link
Member Author

@gaborbernat In case you're curious: I dug deeper, and found the source of the issue. It's related to __PYVENV_LAUNCHER__ being used to determine sys.prefix in site.py: https://foss.heptapod.net/pypy/pypy/issues/3175#note_52025

Since you probably have a lot of experience dealing with these sorts of things, I'd assume that if you have time, any input or advice from you is welcome!

@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

2 participants