spirit-code / spirit

Atomistic Spin Simulation Framework
http://spirit-code.github.io
MIT License
117 stars 52 forks source link

[WinError 126] The specified module could not be found #547

Closed sukhitoteh closed 4 years ago

sukhitoteh commented 4 years ago

Hi, I face the following issues when importing the module:

OSError                                   Traceback (most recent call last)
<ipython-input-4-036241740c6f> in <module>
----> 1 from spirit import state

~\Anaconda3\lib\site-packages\spirit\state.py in <module>
     40 
     41 ### Load Library
---> 42 _spirit = spiritlib.load_spirit_library()
     43 
     44 ### State wrapper class to be used in 'with' statement

~\Anaconda3\lib\site-packages\spirit\spiritlib.py in load_spirit_library()
     25     libname = _get_spirit_lib_name()
     26 
---> 27     ### Load the Spirit library
     28     _spirit = ctypes.CDLL(spirit_py_dir + '/' + libname)
     29 

~\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    354 
    355         if handle is None:
--> 356             self._handle = _dlopen(self._name, mode)
    357         else:
    358             self._handle = handle

OSError: [WinError 126] The specified module could not be found
GPMueller commented 4 years ago

I believe this is because you are using Anaconda, we have always had problems when it was not used, but installed on the system. How did you install spirit? (I have never used conda so it is unclear to me)

Can you try it on a system where you don't have conda?

sukhitoteh commented 4 years ago

I install it with "pip install spirit" on anaconda prompt. Noted, I would give it a try. Thank you.