当我尝试导入 idlpy 时,出现以下 ModuleNotFoundError。
我的输入:
%load_ext idlmagic
import sys
sys.path.append('/Applications/harris/idl88/lib/bridges')
from idlpy import *
错误:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[9], line 3
1 import sys
2 sys.path.append('/Applications/harris/idl88/lib/bridges')
----> 3 from idlpy import *
File /Applications/harris/idl88/lib/bridges/idlpy.py:24
20 # import traceback
21
22 # Dynamically construct the library name from the Python major.minor version.
23 idllibrary = "pythonidl" + str(sys.version_info[0]) + str(sys.version_info[1])
---> 24 pyidl = __import__(idllibrary)
26 # Add IDL's bin directory to the PATH environment variable.
27 # This is needed so IDL can find the licensing libraries.
28 idldir = os.path.dirname(pyidl.__file__)
ModuleNotFoundError: No module named 'pythonidl39'
我尝试在目录(Applications/harris 和 python)中搜索带有术语
*pythonidl*
的模块,但没有任何结果。
我正在尝试使用 Python 到 IDL 桥接器,但仍然无法使其工作。 有人可以帮忙吗?
提前谢谢您!
我使用的 sys.path.append 路径似乎可以工作,是通过运行“locate pythonidl”找到的,我在 Installation_dir/idl90/bin/bin.linux.x86_64 中找到了一些 .so 文件...我在 sys 中使用了这个路径.path.append('idl90/bin/bin.linux.x86_64') 当我单独运行 idlpy.py 时,它似乎绕过了错误,这会给我同样的错误,当我运行时你会得到同样的错误它。我将新路径放入 .bashrc 中,看看这是否会产生影响,看起来确实如此。我还在我试图调用桥的实际 python 脚本中修改了它。
在我的脚本中编辑 sys.path.append 后,我得到以下内容:
% 尝试调用未定义的过程:'PYTHON__DEFINE'。 分段错误(核心转储)
任何有关此错误的帮助将不胜感激。