Moguri / BlenderPanda

Blender addon for integrating Panda3D
MIT License
76 stars 11 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'python2' #10

Closed songproducer closed 8 years ago

songproducer commented 8 years ago

OSX El Capitan Blender 2.78

Starting build
Read assets from: /Users/leotreasure/Panda3dprojects/assets/
Export them to: /Users/leotreasure/Panda3dprojects/game/assets/
Ignoring file patterns: ['*.blend1', '*.blend2']
Build took 0.0003s
Running main file: /Users/leotreasure/Panda3dprojects/game/main.py
Traceback (most recent call last):
  File "/Users/leotreasure/Library/Application Support/Blender/2.78/scripts/addons/BlenderPanda/operators.py", line 199, in execute
    pman.run(config)
  File "/Users/leotreasure/Library/Application Support/Blender/2.78/scripts/addons/BlenderPanda/pman.py", line 292, in run
    args = [get_python_program(config), mainfile]
  File "/Users/leotreasure/Library/Application Support/Blender/2.78/scripts/addons/BlenderPanda/pman.py", line 108, in get_python_program
    retcode = subprocess.call(args, stderr=fp)
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/python/lib/python3.5/subprocess.py", line 560, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/python/lib/python3.5/subprocess.py", line 950, in __init__
    restore_signals, start_new_session)
  File "/Applications/Blender2.78.app/Contents/Resources/2.78/python/lib/python3.5/subprocess.py", line 1540, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'python2'

location: <unknown location>:-1

I tried adding to my bash_profile file:

alias python2='python2.7'

but no luck. I can run Panda3d samples using both python and ppython at the terminal.

I also have a panda3d.pth file in /Library/Python/2.7/site-packages with:

/Developer/Panda3D
/Developer/Panda3D/bin
songproducer commented 8 years ago

Thanks rdb, creating a symlink did the trick!

ln -s $(which ppython) /usr/local/bin/python2

Moguri commented 8 years ago

Reopening this. The symlink is a work-around, and I should address the root issue of BlenderPanda not detecting the correct Python binary to use.

Moguri commented 8 years ago

This should now be fixed with 5fd355131135a406431398471a1fa1a9b9331cb7. Can you try deleting your symlink (/usr/local/bin/python2) and trying again with this new commit? You will want to run Update Project from Blender in the Render properties. This updates the blenderpanda module in your project directory. However, keep in mind that this will wipe out any changes you have to the pman.py in your project directory.

Moguri commented 8 years ago

With 4b05236e7a78c4e6012067917c8a00b2b6adfbaa you should be able to revert your arg hacks. Check the commit log or #12 for information on how to use this new feature.

songproducer commented 8 years ago

Thanks - it works now!!