Interesting, I was able to replicate this here too.
I can see how venv may get confused; it’s being run via mayapy which itself is run under Rosetta 2 for x86 emulation. I would have expected venv to only reference things relative the Python it was called from, but as evident by the actual executable it’s creating, Python
rather than mayapy
, I suspect it’s reaching out into the OS for the binaries, rather than mayapy itself.
I got a handful of clues by attempting to print the venv executable.
marcus@macos ~ % /Applications/Autodesk/maya2022/Maya.app/Contents/bin/mayapy -m venv temptest
marcus@macos ~ % cat ./temptest/bin/Python
??????? H__PAGEZERO?__TEXT__text__TEXTp
p?__stubs__TEXTz?__stub_helper__TEXT???__unwind_info__TEXT?H?__eh_frame__TEXT???__DATA__nl_symbol_ptr__DATA__la_symbol_ptr__DATH__LINKEDIT P ?N"? 8 0 !p!H
P`!
/usr/lib/dyldā^4????r
1?r$
*(?p
hW?/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
P@executable_path/../Frameworks/Python.framework/Python
Those paths at the bottom suggests to me that it’s calling on arm64 things, rather than what Rosetta provides.
To work around it, I would pip install some_package --target ./some/path
whereby you can add ./some/path
to your PYTHONPATH. You could make a shell script to launch you into a shell where this was already set, and remember to install using --target
each time. That should get you into close to what venv would do for you normally.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4ec8665b-97a1-450e-aec4-459a2009947cn%40googlegroups.com.