'_cext' - 导入 OrbitalPy 时没有这样的模块



我正在使用OrbitalPy库在Python中显示轨道。

然而,当我运行程序(实际上在OrbitalPy的文档/示例中列出):

from numpy import radians
from scipy.constants import kilo
from orbital import earth, KeplerianElements, Maneuver, plot, plot3d
from orbital import earth_sidereal_day
molniya = KeplerianElements.with_period(
earth_sidereal_day / 2, e=0.741, i=radians(63.4), arg_pe=radians(270),
body=earth)
plot3d(molniya)

得到以下错误:

C:UsersxxxDesktop>py molniya.py
Traceback (most recent call last):
File "C:UsersxxxDesktopmolniya.py", line 4, in <module>
from orbital import earth, KeplerianElements, Maneuver, plot, plot3d
File "C:UsersxxxAppDataLocalProgramsPythonPython311Libsite-packagesorbital__init__.py", line 8, in <module>
from .plotting import *
File "C:UsersxxxAppDataLocalProgramsPythonPython311Libsite-packagesorbitalplotting.py", line 9, in <module>
import matplotlib as mpl
File "C:UsersxxxAppDataLocalProgramsPythonPython311Libsite-packagesmatplotlib__init__.py", line 246, in <module>
_check_versions()
File "C:UsersxxxAppDataLocalProgramsPythonPython311Libsite-packagesmatplotlib__init__.py", line 240, in _check_versions
module = importlib.import_module(modname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersxxxAppDataLocalProgramsPythonPython311Libimportlib__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersxxxAppDataLocalProgramsPythonPython311Libsite-packageskiwisolver__init__.py", line 8, in <module>
from ._cext import (
ImportError: DLL load failed while importing _cext: The specified module could not be found.

我已经尝试重新安装matplotlib和kiwiisolver,但没有任何帮助。即使是谷歌搜索也没有给我任何关于这个问题的结果。

我也遇到过同样的问题。

这个问题的答案是:

Matplotlib kiwiisolver import problem _next

解决方法就是运行:

pip install msvc-runtime

相关内容

  • 没有找到相关文章

最新更新