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 does not work with the python3 in Xcode 11 beta. #1402

Closed
smoofra opened this issue Aug 6, 2019 · 0 comments · Fixed by #1425

Comments

@smoofra
Copy link

@smoofra smoofra commented Aug 6, 2019

Xcode 11 (now in beta) includes a build of python 3. Additionally Mac OS 10.15 (also in beta) includes a /usr/bin/python3 which is a xcrun stub pointing at Xcode's python.

Unfortunately virtualenv does not work with this python. To reproduce, install MacOS 10.15 beta and Xcode 11 (or CLTools). Then pip3 install virtualenv and python3 -m virtualenv foo_environment. It will not be able to produce a virtualenv.

There are two reasons:

  • virtualenv looks for the string Python.framework. However Xcode's python is called Python3.framework, in order to disambiguate it from the python 2.7 that ships as /System/Library/Frameworks/Python.framework on Mac OS.

  • virtualenv uses mach_o_change() or install_name_tool to change the path that the python binary uses to find Python.framework. This assumes that the original python used an absolute path, but because Xcode is app and is therefore relocatable, Xcode's python uses '@executable_path/../../../../Python3' for this.

steven-hadfield pushed a commit to steven-hadfield/virtualenv that referenced this issue Oct 9, 2019
…ython. Fixes pypa#1402
steven-hadfield pushed a commit to steven-hadfield/virtualenv that referenced this issue Oct 9, 2019
Steven Hadfield Steven Hadfield
gaborbernat added a commit that referenced this issue Oct 10, 2019
* Add support for MacOS 10.15 using Python3.framework for its default python. Fixes #1402

* Add changelog entry for #1402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.