导入本地python库时出错

2024-09-30 20:28:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我想导入一个本地python文件(lumapi.py文件)使用Jupyter Nootbook。我已经在windows10上安装了Python-2.7.14。你知道吗

当我尝试导入源代码*时,会显示此错误消息。你知道吗

WindowsError                              Traceback (most recent call last)
<ipython-input-1-6b82ac779e5e> in <module>()
----> 1 import lumapi

C:\Program Files\Lumerical\FDTD\api\python\lumapi.py in <module>()
     97     return iapi
     98 
---> 99 iapi = initLib()
    100 
    101 class LumApiError(Exception):

C:\Program Files\Lumerical\FDTD\api\python\lumapi.py in initLib()
     54 
     55 def initLib():
---> 56     iapi = CDLL(INTEROPLIB)
     57 
     58     iapi.appOpen.restype = Session

C:\Users\Mohamed Mansour\Anaconda2\lib\ctypes\__init__.pyc in __init__(self, name, mode, handle, use_errno, use_last_error)
    364 
    365         if handle is None:
--> 366             self._handle = _dlopen(self._name, mode)
    367         else:
    368             self._handle = handle

WindowsError: [Error 126] The specified module could not be found

我试图用水蟒来解决这个问题。你知道吗

>> pip install -f https://github.com/Illumina/interop/releases/latest interop
Requirement already satisfied: interop in c:\users\mohamed mansour\anaconda2\lib\site-packages
Requirement already satisfied: numpy>=1.13 in c:\users\mohamed mansour\anaconda2\lib\site-packages (from interop)
>> python -m interop --version
1.1.4
>> python -m interop --test
..............................
----------------------------------------------------------------------
Ran 30 tests in 0.300s

OK

这个问题仍然存在。你知道怎么解决这个错误吗?你知道吗

*您可以从这个link检查完整的源代码。你知道吗


Tags: 文件inpyself源代码lib错误last