0
$\begingroup$

So far I successfully run my Blender Python scripts externally in the PyCharm-IDE like this:

![enter image description here

However if I try to run the script iso.py as module via the external script render_buildings.py I get an error :

Python: Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'iso'

enter image description here

The module iso.py is actually in the same directory as the called script render_buildings.py and it also contains an empty init.py script like the Python specification demands.

How to fix it, any ideas ?

$\endgroup$
6
  • 1
    $\begingroup$ there are 2 python versions on your computer, one "normal", one "inside" Blender. If you are using a python lib, you have to install it inside Blender. A tutorial is here: youtu.be/2zGIERHU2mk?si=q9mFRNVL3RGCmoca $\endgroup$
    – Chris
    Feb 24 at 12:17
  • $\begingroup$ @Chris unfortunately the script does not work on my windows system as it was written und tested originally for MacOs. But at least I have an idea why this would not work. $\endgroup$
    – Andy
    Feb 24 at 12:33
  • $\begingroup$ so your pycharm IDE run on a Mac? $\endgroup$
    – Chris
    Feb 24 at 12:34
  • $\begingroup$ UnboundLocalError: local variable 'python_exe' referenced before assignment and UnboundLocalError: local variable 'sys' referenced before assignment $\endgroup$
    – Andy
    Feb 24 at 12:38
  • $\begingroup$ Pycharm and blender both run on Windows $\endgroup$
    – Andy
    Feb 24 at 12:40

0

You must log in to answer this question.

Browse other questions tagged .