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.