安装isacalc模块后,我编写了自述文件中给出的示例代码。
然后我得到错误:
runfile('C:/Users/Black/Documents/1-Neff Aero/Python
Plots/isacalctest.py', wdir='C:/Users/Black/Documents/1-Neff Aero/Python
Plots')
Traceback (most recent call last):
File "C:\Users\Black\Documents\1-Neff Aero\Python Plots\isacalctest.py",
line 8, in <module>
import isacalc as isa
File "C:\ProgramData\Anaconda3\lib\site-packages\isacalc\__init__.py",
line 1, in <module>
from isacalc.main_executable import calculate_at_h, get_atmosphere
File "C:\ProgramData\Anaconda3\lib\site-
packages\isacalc\main_executable.py", line 1, in <module>
from src import Atmosphere
ModuleNotFoundError: No module named 'src'
我写的代码:
import isacalc as isa
atmosphere = isa.get_atmosphere()
h = 11000.0
T,P,d,a,mu = isa.calculate_at_h(h,atmosphere)
答案 0 :(得分:1)
我在一个virtualenv中安装了isacalc,并查看了<venv>\Lib\site-packages\isacalc
。这是我发现的:
嗯,很奇怪!没有src
目录,无法从中导入Atmosphere
。
不用担心,只需从GitHub repo下载src
目录并将其放在isacalc
目录中即可。
问题已解决!