isacalc说没有名为“ src”的模块

时间:2020-07-31 19:05:06

标签: python

安装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)

1 个答案:

答案 0 :(得分:1)

我在一个virtualenv中安装了isacalc,并查看了<venv>\Lib\site-packages\isacalc。这是我发现的:

enter image description here

嗯,很奇怪!没有src目录,无法从中导入Atmosphere

不用担心,只需从GitHub repo下载src目录并将其放在isacalc目录中即可。

enter image description here

问题已解决!