我在Windows 11的Conda虚拟环境中运行代码时遇到了一个问题。当我在Python 3.11环境中尝试执行from quanestimation import *
时,出现了一个错误,具体是unable to load ijl_arraylen from libjulia-internal
。python导入quanestimation库时需要依赖julia。
以下是我为解决这个问题所采取的步骤:
- 依赖性验证:我已确保所有必需的依赖项都已正确安装。
- Julia版本测试:起初,我怀疑问题可能与Julia版本有关。我尝试了最新版本Julia 1.11,然后降级到1.10.6,再降到1.10.0。不幸的是,这些版本都出现了相同的错误。
- 错误假设:基于我的测试,我怀疑这个问题可能是Julia本身固有的。
如果有任何指导或建议能解决这个问题,我将不胜感激。感谢您对此事的关注。
感谢您的建议。但是我试了一下,还是有问题。具体报错:
>>> import quanestimation
free(): invalid pointer
[42613] signal (6.-6): Aborted
in expression starting at none:2
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7ff29f70026d)
unknown function (ip: 0x7ff29f7082fb)
unknown function (ip: 0x7ff29f709b2b)
unknown function (ip: 0x4ff3f8)
_Py_DECREF at /usr/local/src/conda/python-3.10.15/Include/object.h:500 [inlined]
_Py_XDECREF at /usr/local/src/conda/python-3.10.15/Include/object.h:567 [inlined]
_PyImport_LoadDynamicModuleWithSpec at /usr/local/src/conda/python-3.10.15/Python/importdl.c:244 [inlined]
_imp_create_dynamic_impl at /usr/local/src/conda/python-3.10.15/Python/import.c:2050 [inlined]
_imp_create_dynamic at /usr/local/src/conda/python-3.10.15/Python/clinic/import.c.h:330
cfunction_vectorcall_FASTCALL at /usr/local/src/conda/python-3.10.15/Objects/methodobject.c:430
do_call_core at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5917 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4277
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4181
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4198
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4213
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4213
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4213
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
object_vacall at /usr/local/src/conda/python-3.10.15/Objects/call.c:734
_PyObject_CallMethodIdObjArgs at /usr/local/src/conda/python-3.10.15/Objects/call.c:825
import_find_and_load at /usr/local/src/conda/python-3.10.15/Python/import.c:1522 [inlined]
PyImport_ImportModuleLevelObject at /usr/local/src/conda/python-3.10.15/Python/import.c:1623
import_name at /usr/local/src/conda/python-3.10.15/Python/ceval.c:6018 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:3695
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067
PyEval_EvalCode at /usr/local/src/conda/python-3.10.15/Python/ceval.c:1134
builtin_exec_impl at /usr/local/src/conda/python-3.10.15/Python/bltinmodule.c:1058 [inlined]
builtin_exec at /usr/local/src/conda/python-3.10.15/Python/clinic/bltinmodule.c.h:371
cfunction_vectorcall_FASTCALL at /usr/local/src/conda/python-3.10.15/Objects/methodobject.c:430
do_call_core at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5917 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4277
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4181
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4198
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4213
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
PyObject_Vectorcall at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:123 [inlined]
call_function at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5893 [inlined]
_PyEval_EvalFrameDefault at /usr/local/src/conda/python-3.10.15/Python/ceval.c:4213
_PyEval_EvalFrame at /usr/local/src/conda/python-3.10.15/Include/internal/pycore_ceval.h:46 [inlined]
_PyEval_Vector at /usr/local/src/conda/python-3.10.15/Python/ceval.c:5067 [inlined]
_PyFunction_Vectorcall at /usr/local/src/conda/python-3.10.15/Objects/call.c:342
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:114 [inlined]
object_vacall at /usr/local/src/conda/python-3.10.15/Objects/call.c:734
_PyObject_CallMethodIdObjArgs at /usr/local/src/conda/python-3.10.15/Objects/call.c:825
import_find_and_load at /usr/local/src/conda/python-3.10.15/Python/import.c:1522 [inlined]
PyImport_ImportModuleLevelObject at /usr/local/src/conda/python-3.10.15/Python/import.c:1623
builtin___import__ at /usr/local/src/conda/python-3.10.15/Python/bltinmodule.c:272
cfunction_call at /usr/local/src/conda/python-3.10.15/Objects/methodobject.c:543
_PyObject_MakeTpCall at /usr/local/src/conda/python-3.10.15/Objects/call.c:215
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:112 [inlined]
_PyObject_VectorcallTstate at /usr/local/src/conda/python-3.10.15/Include/cpython/abstract.h:99 [inlined]
_PyObject_CallFunctionVa at /usr/local/src/conda/python-3.10.15/Objects/call.c:485 [inlined]
PyObject_CallFunction at /usr/local/src/conda/python-3.10.15/Objects/call.c:507
PyImport_Import at /usr/local/src/conda/python-3.10.15/Python/import.c:1828
PyImport_Import at /root/anaconda3/envs/QuanEstimation-env/julia_project/quanestimation-1.10.6/depot/packages/PythonCall/Nr75f/src/C/pointers.jl:303 [inlined]
macro expansion at /root/anaconda3/envs/QuanEstimation-env/julia_project/quanestimation-1.10.6/depot/packages/PythonCall/Nr75f/src/Core/Py.jl:132 [inlined]
pyimport at /root/anaconda3/envs/QuanEstimation-env/julia_project/quanestimation-1.10.6/depot/packages/PythonCall/Nr75f/src/Core/builtins.jl:1561
init_consts at /root/anaconda3/envs/QuanEstimation-env/julia_project/quanestimation-1.10.6/depot/packages/PythonCall/Nr75f/src/Core/consts.jl:205
__init__ at /root/anaconda3/envs/QuanEstimation-env/julia_project/quanestimation-1.10.6/depot/packages/PythonCall/Nr75f/src/Core/Core.jl:42
jfptr___init___8601 at /root/anaconda3/envs/QuanEstimation-env/julia_project/quanestimation-1.10.6/depot/compiled/v1.10/PythonCall/WdXsa_g8jxb.so (unknown line)
_jl_invoke at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
jl_module_run_initializer at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/toplevel.c:76
run_module_init at ./loading.jl:1134
register_restored_modules at ./loading.jl:1122
_include_from_serialized at ./loading.jl:1067
_require_search_from_serialized at ./loading.jl:1581
_require at ./loading.jl:1938
__require_prelocked at ./loading.jl:1812
jfptr___require_prelocked_80976.1 at /root/packages/julias/julia-1.10/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
jl_f__call_in_world at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/builtins.c:831
#invoke_in_world#3 at ./essentials.jl:926 [inlined]
invoke_in_world at ./essentials.jl:923 [inlined]
_require_prelocked at ./loading.jl:1803
macro expansion at ./loading.jl:1790 [inlined]
macro expansion at ./lock.jl:267 [inlined]
__require at ./loading.jl:1753
jfptr___require_80941.1 at /root/packages/julias/julia-1.10/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
jl_f__call_in_world at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/builtins.c:831
#invoke_in_world#3 at ./essentials.jl:926 [inlined]
invoke_in_world at ./essentials.jl:923 [inlined]
require at ./loading.jl:1746
jfptr_require_80938.1 at /root/packages/julias/julia-1.10/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
ijl_apply_generic at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
call_require at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/toplevel.c:481 [inlined]
eval_import_path at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/toplevel.c:518
jl_toplevel_eval_flex at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/toplevel.c:805
eval_body at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/interpreter.c:583
eval_body at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/interpreter.c:544
eval_body at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/interpreter.c:544
jl_interpret_toplevel_thunk at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/interpreter.c:775
jl_toplevel_eval_flex at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/toplevel.c:934
jl_toplevel_eval_flex at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/toplevel.c:877
ijl_toplevel_eval_in at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/toplevel.c:985
ijl_eval_string at /cache/build/builder-amdci5-5/julialang/julia-release-1-dot-10/src/jlapi.c:117
ffi_call_unix64 at /root/anaconda3/envs/QuanEstimation-env/lib/python3.10/lib-dynload/../../libffi.so.8 (unknown line)
ffi_call_int at /root/anaconda3/envs/QuanEstimation-env/lib/python3.10/lib-dynload/../../libffi.so.8 (unknown line)
ffi_call at /root/anaconda3/envs/QuanEstimation-env/lib/python3.10/lib-dynload/../../libffi.so.8 (unknown line)
_call_function_pointer at /usr/local/src/conda/python-3.10.15/Modules/_ctypes/callproc.c:916 [inlined]
_ctypes_callproc at /usr/local/src/conda/python-3.10.15/Modules/_ctypes/callproc.c:1262
PyCFuncPtr_call at /usr/local/src/conda/python-3.10.15/Modules/_ctypes/_ctypes.c:4221
_PyObject_MakeTpCall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
unknown function (ip: 0x5924f1)
PyEval_EvalCode at python (unknown line)
unknown function (ip: 0x59992c)
unknown function (ip: 0x4fd123)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
unknown function (ip: 0x4fc703)
_PyObject_CallMethodIdObjArgs at python (unknown line)
PyImport_ImportModuleLevelObject at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
unknown function (ip: 0x5924f1)
PyEval_EvalCode at python (unknown line)
unknown function (ip: 0x5c3236)
unknown function (ip: 0x5be37f)
unknown function (ip: 0x4d4ab6)
_PyRun_InteractiveLoopObject at python (unknown line)
unknown function (ip: 0x458d03)
PyRun_AnyFileExFlags at python (unknown line)
unknown function (ip: 0x45566b)
Py_BytesMain at python (unknown line)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x5854bd)
Allocations: 2909 (Pool: 2899; Big: 10); GC: 0
Aborted (core dumped)