Repository: pypa/virtualenv

Issue #1561: framework build CPython macOs issues
Created: 2020-02-10T22:47:16Z
Hi. I'm trying to create a Python 2 virtualenv on macOS Mojave and am running into an error.
bagel$ pip3 install --user virtualenv
  <snipped>
  WARNING: The script virtualenv is installed in '/Users/bagel/Library/Python/3.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed virtualenv-20.0.1

bagel$ pip3 list
Package            Version
------------------ -------
appdirs            1.4.3  
filelock           3.0.12 
importlib-metadata 1.5.0  
pip                19.3.1 
setuptools         42.0.2 
six                1.14.0 
virtualenv         20.0.1 
wheel              0.33.6 
zipp               2.2.0  

bagel$ which python2.7
/usr/bin/python2.7

bagel$ ~/Library/Python/3.7/bin/virtualenv -p python2.7 venv
PermissionError: [Errno 1] Operation not permitted: '/Users/bagel/Documents/projects/test/venv/bin/python'
It's worth noting that Python 2 is the system Python, while Python 3 is installed from Homebrew.

Duplicate issue #1633: ci: ERROR collecting tests/unit/discovery/py_info/test_py_info_exe_based_of.py 
Created: 2020-02-14T18:03:07Z
I seen error below on CI and seems totally unrelated to the change being tested.
https://dev.azure.com/pypa/virtualenv/_build/results?buildId=19019&view=logs&jobId=cc0564e1-d822-5f24-0bbb-f60430a68e65&j=cc0564e1-d822-5f24-0bbb-f60430a68e65&t=9fc317a6-b66c-593b-646c-b1040cd24f7e
==================================== ERRORS ====================================
__ ERROR collecting tests/unit/discovery/py_info/test_py_info_exe_based_of.py __
tests/unit/discovery/py_info/test_py_info_exe_based_of.py:20: in <module>
    BASE = {str(Path(CURRENT.executable).parent.relative_to(Path(CURRENT.prefix))), "."}
/usr/local/lib/python2.7/site-packages/pathlib2/__init__.py:1132: in relative_to
    .format(str(self), str(formatted)))
E   ValueError: '/usr/local/opt/python@2/bin' does not start with '/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7'
- generated xml file: /Users/runner/runners/2.164.8/work/1/s/.tox/junit.py27-lower.xml -
==================================== ERRORS ====================================
__ ERROR collecting tests/unit/discovery/py_info/test_py_info_exe_based_of.py __
tests/unit/discovery/py_info/test_py_info_exe_based_of.py:20: in <module>
    BASE = {str(Path(CURRENT.executable).parent.relative_to(Path(CURRENT.prefix))), "."}
/usr/local/lib/python2.7/site-packages/pathlib2/__init__.py:1132: in relative_to
    .format(str(self), str(formatted)))
E   ValueError: '/usr/local/opt/python@2/bin' does not start with '/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7'
- generated xml file: /Users/runner/runners/2.164.8/work/1/s/.tox/junit.py27-lower.xml -
==================================== ERRORS ====================================
__ ERROR collecting tests/unit/discovery/py_info/test_py_info_exe_based_of.py __
tests/unit/discovery/py_info/test_py_info_exe_based_of.py:20: in <module>
    BASE = {str(Path(CURRENT.executable).parent.relative_to(Path(CURRENT.prefix))), "."}
/usr/local/lib/python2.7/site-packages/pathlib2/__init__.py:1132: in relative_to
    .format(str(self), str(formatted)))
E   ValueError: '/usr/local/opt/python@2/bin' does not start with '/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7'
- generated xml file: /Users/runner/runners/2.164.8/work/1/s/.tox/junit.py27-lower.xml -
==================================== ERRORS ====================================
__ ERROR collecting tests/unit/discovery/py_info/test_py_info_exe_based_of.py __
tests/unit/discovery/py_info/test_py_info_exe_based_of.py:20: in <module>
    BASE = {str(Path(CURRENT.executable).parent.relative_to(Path(CURRENT.prefix))), "."}
/usr/local/lib/python2.7/site-packages/pathlib2/__init__.py:1132: in relative_to
    .format(str(self), str(formatted)))
E   ValueError: '/usr/local/opt/python@2/bin' does not start with '/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7'
- generated xml file: /Users/runner/runners/2.164.8/work/1/s/.tox/junit.py27-lower.xml -

For sure I was not ablet to reprodue the same error locally, on same platform.

Closing comment (2020-02-16T09:14:22Z): Confirmed; it's duplicate of #1561