[英]ImportError: DLL load failed: The specified module could not be found. (Python rocketcea wrapper for NASA Fortran CEA)
I am trying to use the rocketcea (installed via pip rather than cloning the git) wrapper for NASA's CEA code, but I recieve the following error in the title when I try to run their example code:我正在尝试为 NASA 的 CEA 代码使用Rocketcea (通过 pip 安装而不是克隆 git)包装器,但是当我尝试运行他们的示例代码时,我在标题中收到以下错误:
#example code
from rocketcea.cea_obj import CEA_Obj
C = CEA_Obj( oxName='LOX', fuelName='LH2')
for mr in range(2,9):
print(mr, C.get_Isp(Pc=100.0, MR=mr, eps=40.0) )
Resulting error (Python 3.7 launched from the PyCharm IDE):结果错误(从 PyCharm IDE 启动的 Python 3.7):
Traceback (most recent call last):
File "C:/Users/George/Documents/SpaceportTXV/cea test/cea import.py", line 1, in <module>
from rocketcea.cea_obj import CEA_Obj
File "C:\Users\George\AppData\Local\Programs\Python\Python37-32\lib\site-packages\rocketcea\cea_obj.py", line 51, in <module>
import rocketcea.py_cea as py_cea
ImportError: DLL load failed: The specified module could not be found.
I am using the MinGW GCC compiler suite, and I have added both bin and lib to my PATH as rocketcea recommends to resolve the issue.我正在使用 MinGW GCC 编译器套件,并且我已将 bin 和 lib 添加到我的 PATH 中,因为 Rocketcea 建议解决此问题。
My PATH:我自己的路:
C:\Users\George>echo %PATH%
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Users\George\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\George\AppData\Local\Programs\Python\Python37-32\;C:\Users\George\AppData\Local\Microsoft\WindowsApps;C:\Users\George\AppData\Local\Programs\mingw\mingw64\bin;C:\Users\George\AppData\Local\Programs\mingw\mingw64\lib;
If it helps, link to what my rocketcea folder contains.如果有帮助,请链接到我的 Rocketcea 文件夹中包含的内容。
If anyone has any insight as to why I am having this error, I would greatly appreciate it.如果有人对我为什么会出现此错误有任何见解,我将不胜感激。 I can also add any additional information that may be helpful
我还可以添加任何可能有用的附加信息
I don't know if an alternative solution will have been found by now, but after struggling for hours on end with this, I found a way to make the error message go away.我不知道现在是否会找到替代解决方案,但是在为此苦苦挣扎了几个小时之后,我找到了一种方法来消除错误消息。 This was done òn Windows 10 with an Anaconda3 install running Python 3.6.8 x64, but the core idea is that in
C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\rocketcea
, one can navigate to ..\\rocketcea\\.libs
, where a .dll file resides.这是在 Windows 10 上通过运行 Python 3.6.8 x64 的 Anaconda3 安装完成的,但核心思想是在
C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\rocketcea
,可以导航到..\\rocketcea\\.libs
,.dll 文件所在的位置。 I added the path to this .libs folder to my Path variable, and on calling the test code again, it ran.我将这个 .libs 文件夹的路径添加到我的 Path 变量中,并在再次调用测试代码时,它运行了。
I hope this helps.我希望这有帮助。
As a side note, I also added the path to the python3.dll
file in my python install folder to the Path variable, but I suspect the rocketcea specific .dll was the true key.作为旁注,我还将 python 安装文件夹中
python3.dll
文件的路径添加到 Path 变量,但我怀疑 Rocketcea 特定的 .dll 是真正的关键。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.