[issue38705] venv creation on macOS Catalina is failing

Nikhil Benesch report at bugs.python.org
Mon Oct 26 23:42:44 EDT 2020


Nikhil Benesch <nikhil.benesch at gmail.com> added the comment:

So it looks like /usr/bin/python3 is just a shim that immediately execs the real Python binary:

    /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3

This binary is identical to the one that ends up in the venv.

Problematically, this binary is dynamically linked, and links the "Python3" shared library using a relative path:

$ otool -L /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3:
	@executable_path/../Python3 (compatibility version 3.8.0, current version 3.8.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)

So obviously copying that binary to a different path breaks the @executable_path-relative link. Ah, well. Definitely seems like Apple's bug. Not sure there is anything that even could be done on the CPython side.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38705>
_______________________________________


More information about the Python-bugs-list mailing list