0

the question is may be similar to this one, but did not solve my issue and also is somehow much stranger:

I got a strange problem, where when executing only my python file from command line: >python main.py, everything works. But when using it with blender like this:

blender -b ..\test.blend --pyhton ..\main.py

i get this error (file paths are substituted with ..) :

Traceback (most recent call last):
File "\\...\Blender\2.78\python\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 2, in <module>
File "...\main.py", line 4, in <module>
import numpy as np
File "\\...\Blender\2.78\python\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "\\...\Blender\2.78\python\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "\\...\Blender\2.78\python\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "\\...\Blender\2.78\python\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "\\...\Blender\2.78\python\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead

my main.py looks like this:

#import bpy
import sys
import numpy
import h5py
...more imports...

if __name__ == "__main__":
  logging.info("No error")

The story I told so far, is fact, when I run the blender and python from a HTCondor Windows node. Again, only the python file works fine, but when including blender the DLL error occurs.

Additionally I tested everything before on my local PC where both variations work without issues, using exactly the same files! (Everything is located on a NAS drive)

There must be some linkage to some python stuff on my pc. I only have the miniconda3 directory, which i completely removed so blender can use the bundled one.

Hopefully somebody can help me and please feel free to ask for stuff I failed to explain.

EDIT:

The multiarray module is located in the numpy.core folder with the name mutliarray.cp35-win_amd64.pyd, which makes no sense to me why the module is found on my local PC but not on the HTCondor windows node.

EDIT 2:

According to sampler's suggestions I tried the following:

1) I used getenv = True in the submission file to submit the locally working environment with the job. Result: Does not work either.

2) I cleared all environment variables except those needed for running correctly on my local pc. Clearence happend with this lines:

for i in os.environ:
  os.environ[i] = "" 

The only used variable is set:

os.environ["PATH"] = "\\\\[servername]\\conda\\Blender\\2.78\\python\\Library\\bin;"

without this line I get the same multiarray import error on my local pc. These lines are executed in my main.py script but still does not change anything when running on the condor node.

Even stranger is the fact, that running only the python script on the condor node works perfektly fine, but just running it with blender (as shown in the first codeline of this post), results in the multiarray import error.

Community
  • 1
  • 1
mrks
  • 141
  • 2
  • 15
  • 1
    When you say condor server, I expect you are referring to windows nodes in a [HTCondor](https://en.wikipedia.org/wiki/HTCondor) setup - check [7.4 in the docs](http://research.cs.wisc.edu/htcondor/manual/v7.6.4/7_4Condor_on.html) – sambler Feb 16 '17 at 07:13
  • yes, I refer to windows nodes in a HTCondor setup. As written in my edit, the file is there but is not recoginzed on one system!? (name: mutliarray.cp35-win_amd64.pyd) – mrks Feb 20 '17 at 09:06
  • 1
    And the third entry on the docs page I linked to specifically explains code that runs on local windows but not on condor - it starts with an empty PATH so doesn't find files properly - a `.pyd` file is a compiled python module which is a shared library not just a text file with python code in it. – sambler Feb 21 '17 at 02:48
  • I tried some of your suggestions, hopefully correctly, and added them to the edit2 section. I already set the PATH, as described, but what do you mean with the -a? – mrks Feb 21 '17 at 08:00
  • The setup notes in the docs refer to the condor job config not the blender script. Not sure that setting environment variable in python will allow the system to see the change. I expect the path needs to include libraries that the numpy libs are linked to, on *nix that would be something like `/usr/local/lib` or `/usr/local/lib/gcc49` and it may be more than one path, not just the blender location. This will allow the system to find all the libraries it needs to work. – sambler Feb 21 '17 at 08:23

0 Answers0