简体   繁体   中英

Run Blender from python script

I am trying to learn how to run blender commands from external python script, I am reading this tutorial from GitHub . However when I run the first test blender -b -P run_script.py I get the following error message:

Read new prefs: /home/sim/.config/blender/2.76/config/userpref.blend

RNA_def_property_ui_text: 'option_extra_vgroups' '' description ends with a '.' ! RNA_def_property_ui_text: 'option_index_type' '' description ends with a '.' !

Traceback (most recent call last):   File "/home/sim/Desktop/WebApp/Blender/blender-scripting-master/run_script.py", line 22, in <module>
    exec(compile(open(file).read(), scriptFile, 'exec'))

  File "fisher_iris_visualization.py", line 3, in <module>
    import numpy as np ImportError: No module named 'numpy'

Then Blender quit

Do you have any idea to solve that? Thank you very much in advance!

It seems like you didn't import numpy module in your script.

It is my guess, without any code, it is not easy for me to debug.

I doesn't look like you have the numpy library installed on your system.

can you verify with;

python -c 'import numpy; numpy.test()'

if it errors out then install numpy with

sudo apt-get install python-numpy

or

pip install --user numpy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM