morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
353 stars 156 forks source link

remove system python libs from path by default #715

Open PierrickKoch opened 7 years ago

PierrickKoch commented 7 years ago

commits https://github.com/morse-simulator/morse/commit/836502512c0020c846f7a10a4a9c22c4630a8d25 and https://github.com/morse-simulator/morse/commit/4fdcae68af5b7779cd2735b3b31a7bc655d6acb2 allow to run morse with blender from http://download.blender.org/release without conflicting with local python libs, with the following environment variables set:

export MORSE_SILENT_PYTHON_CHECK=1
export MORSE_POP_PYTHONLIB="/usr/lib/python3.5"

We might want to remove system python libs by default, with something like:

sys.path = filter(lambda p: not p.split('/')[-1].startswith('python'), sys.path)

Though, this might be a problem if Blender was installed from source or with system package manager, in which case Python is not packaged with it. We might figure out a simple test for that...