I am encountering a program crash with the following error message:
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffd31cebf5e – DllCanUnloadNow at C:\Users\zhouz\anaconda3\envs\causaldis\DLLs_ctypes.pyd (unknown line)
in expression starting at none:0
DllCanUnloadNow at C:\Users\zhouz\anaconda3\envs\causaldis\DLLs_ctypes.pyd (unknown line)
unknown function (ip: 00007ffd31ce6f11)
PyObject_MakeTpCall at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
PyObject_Vectorcall at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
PyEval_EvalCode at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
PyRun_FileExFlags at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
PyRun_FileExFlags at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
PyRun_StringFlags at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
PyRun_SimpleFileObject at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
PyRun_AnyFileObject at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
Py_gitidentifier at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
Py_gitidentifier at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
Py_RunMain at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
Py_Main at C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll (unknown line)
OPENSSL_Applink at C:\Users\zhouz\anaconda3\envs\causaldis\python.exe (unknown line)
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
Allocations: 408549740 (Pool: 408545602; Big: 4138); GC: 584
I am calling Julia functions from Python using Pyjulia. After doing the code you mentioned, I could not launch Julia from Python with this error:
Traceback (most recent call last):
File "C:\Users\zhouz\Purdue\CausalML\proj\Sample Efficient\RootPicking.py", line 8, in <module>
from julia import Main
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 921, in _load_unlocked
File "<frozen importlib._bootstrap>", line 813, in module_from_spec
File "C:\Users\zhouz\anaconda3\envs\causaldis\Lib\site-packages\julia\core.py", line 253, in create_module
JuliaMainModule(self, fullname))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zhouz\anaconda3\envs\causaldis\Lib\site-packages\julia\core.py", line 151, in __init__
self._julia = loader.julia
^^^^^^^^^^^^
File "C:\Users\zhouz\anaconda3\envs\causaldis\Lib\site-packages\julia\core.py", line 242, in julia
self.__class__.julia = julia = Julia()
^^^^^^^
File "C:\Users\zhouz\anaconda3\envs\causaldis\Lib\site-packages\julia\core.py", line 495, in __init__
raise UnsupportedPythonError(jlinfo)
julia.core.UnsupportedPythonError: It seems your Julia and PyJulia setup are not supported.
Julia executable:
julia
Python interpreter and libpython used by PyCall.jl:
C:\Users\zhouz\.julia\conda\3\x86_64\python.exe
C:\Users\zhouz\.julia\conda\3\x86_64\python310.dll
Python interpreter used to import PyJulia and its libpython.
C:\Users\zhouz\anaconda3\envs\causaldis\python.exe
C:\Users\zhouz\anaconda3\envs\causaldis\python312.dll
In Julia >= 0.7, above two paths to `libpython` have to match exactly
in order for PyJulia to work out-of-the-box. To configure PyCall.jl to use
Python interpreter "C:\Users\zhouz\anaconda3\envs\causaldis\python.exe",
run the following code in the Python REPL:
>>> import julia
>>> julia.install()
For more information, see:
https://pyjulia.readthedocs.io/en/latest/troubleshooting.html
Process finished with exit code 1
It is not really clear to me what you actually want to do.
do you want to use Python from Julia, e.g. by using PyPlot?
do you want to use Julia from Python?
do you want to use both?
Doing one of these things should be easy, doing both is not easy… You then need either two different Python environments, or you need to use only packages for both scenarios that are compatible…
Can you explain in more detail what you actually want to do, and which Python packages and which Python environment(s) you want to use?
In theory you can use either PyJulia, or juliacall for this purpose. PyJulia is the old way of doing it (and might break easily), and juliacall the new way of doing it, but I never used any of these two packages, so I cannot give any advice on this topic.