无法导入所需的依赖项,Python 与 Pandas 和 Numpy

Unable to import required dependencies, Python with Pandas and Numpy

我认为这个问题以前在互联网上被问过,但目前提出的解决方案没有奏效。

我正在尝试 运行 导入 numpy 和 pandas 的脚本。当我 运行 在 IDE (PyCharm) 中使用 Python 控制台时,一切正常。但是,当我从命令行 运行 脚本时,显示以下错误:

DLL load failed: The specified module could not be found.

Unable to import required dependencies

我正在使用 Anaconda Navigator。那里列出了我的 Pandas 和 Numpy。我尝试通过 conda shell 卸载它们(conda uninstall numpy,conda uninstall pandas),然后再次安装它们,但没有结果。

希望大家帮忙。

如果你还没有调用它(没有引号)

conda activate "name of environment that has your modules installed"

经过反复试验,我卸载了 Anaconda 并安装了 pip。然后我使用 pip 安装了模块,效果非常好。

(不是最优雅的答案,因为它没有首先解释为什么会出错,但它至少提供了一个可行的解决方案。)