I have been writing code in Python 3 on Windows 10 and need to call a function which was written in Julia, so I have installed Julia and PyJulia. I have encountered a very strange problem, however: while I can import and call Julia modules just fine in Python terminal (though importing them can take an unexpected few seconds), trying to import any Julia module in a Python script will give an error.
I can run a line
import julia
just fine, but something as simple as
from julia import Base
will give the two dialog boxes and error in terminal screenshotted below. My question is simply, does anyone know what is going on here, or how to fix it? Thanks.
from julia import Base
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
File "C:\ProgramData\Anaconda3\lib\site-packages\julia\core.py", line 248, in load_module
elif self.julia.isafunction(juliapath):
File "C:\ProgramData\Anaconda3\lib\site-packages\julia\core.py", line 239, in julia
self.__class__.julia = julia = Julia()
File "C:\ProgramData\Anaconda3\lib\site-packages\julia\core.py", line 472, in __init__
self.api = LibJulia.from_juliainfo(jlinfo)
File "C:\ProgramData\Anaconda3\lib\site-packages\julia\libjulia.py", line 195, in from_juliainfo
sysimage=juliainfo.sysimage,
File "C:\ProgramData\Anaconda3\lib\site-packages\julia\libjulia.py", line 215, in __init__
self.libjulia = ctypes.PyDLL(libjulia_path, ctypes.RTLD_GLOBAL)
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 127] The specified procedure could not be found