NatronGitHub / Natron

Open-source video compositing software. Node-graph based. Similar in functionalities to Adobe After Effects and Nuke by The Foundry.
http://NatronGitHub.github.io
GNU General Public License v2.0
4.71k stars 343 forks source link

Natron 2.5 doesn't set python sys.prefix and sys.exec_prefix #696

Closed devernay closed 3 years ago

devernay commented 3 years ago

Natron 2.4.1 (python 2):

$ /Applications/Natron\ 2.4.1\ macOS11.app/Contents/MacOS/natron-python -c "import sys; print('prefix=%s, exec_prefix=%s' %(sys.prefix,sys.exec_prefix))"
prefix=/Applications/Natron 2.4.1 macOS11.app/Contents/MacOS/../Frameworks/Python.framework/Versions/2.7, exec_prefix=/Applications/Natron 2.4.1 macOS11.app/Contents/MacOS/../Frameworks/Python.framework/Versions/2.7

Natron 2.5.0-alpha.1 (python 3):

$ /Applications/Natron\ 2.5.0\ macOS12.app/Contents/MacOS/natron-python -c "import sys; print('prefix=%s, exec_prefix=%s' %(sys.prefix,sys.exec_prefix))"
prefix=, exec_prefix=

Probably because Py_SetPath sets prexif and exec_prefix to empty values?

In this case, we would have to set these after Py_Initialize, using PySys_SetObject

note that this causes pip to install modules in the current directory rather than in Natron's python home.

devernay commented 3 years ago

fixed by https://github.com/NatronGitHub/Natron/commit/376252e706d4ff1e5db4f5ea410500aa1676f840