简体   繁体   English

导入多阵列Numpy扩展模块失败的Visual Studio 2019 Anaconda 1.9.6 Python 3.7.1

[英]Importing the multiarray Numpy extension module failed Visual Studio 2019 Anaconda 1.9.6 Python 3.7.1

I have a fresh install of Anaconda (1.9.6) and elected to install Visual Studio 2019 as part of this process. 我重新安装了Anaconda(1.9.6),并选择安装Visual Studio 2019作为此过程的一部分。 The code below executes without error in the Spyder IDE bundled with Anaconda, but in Visual Studio it returns the following error: 下面的代码在与Anaconda捆绑在一起的Spyder IDE中执行时没有错误,但是在Visual Studio中,它返回以下错误:

"Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. If you're working with a numpy git repo, try git clean -xdf (removes all files not under version control). Otherwise reinstall numpy. Original error was: DLL load failed: The specified module could not be found." “导入多阵列numpy扩展模块失败。很可能您正在尝试导入构建失败的numpy。如果您正在使用numpy git repo,请尝试git clean -xdf (删除所有不受版本控制的文件)。否则重新安装numpy。原始错误是:DLL加载失败:找不到指定的模块。”

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 20, 100)  # Create a list of evenly-spaced numbers over the range
plt.plot(x, np.sin(x))       # Plot the sine of each x point
plt.show()                   # Display the plot

My Python environment in VS is Python 3.7.1 64-bit ('base':conda). 我在VS中的Python环境是64位Python 3.7.1('base':conda)。 I believe I am using the same Python environment as Anaconda and I have never installed Python on this machine before. 我相信我使用的是与Anaconda相同的Python环境,并且以前从未在此计算机上安装过Python。 Further, I am not working with a "numpy git repo". 此外,我不使用“ numpy git repo”。

My questions are these: 我的问题是:

Why does Visual Studio fail to import Numpy when Spyder can and they share environments? 当Spyder可以共享环境时,为什么Visual Studio无法导入Numpy? and How do I make Visual Studio work with Numpy? 以及如何使Visual Studio与Numpy一起使用?

Note, although this may look like a duplicate question, other questions have used previous VS releases (which refer to Solutions Explorer, which VS2019 no longer has), don't start with Anaconda as the Python environment, or refer to Python 2.x. 请注意,尽管这看起来像是一个重复的问题,但其他问题都使用了先前的VS版本(指的是解决方案资源管理器,VS2019不再具有),不要以Anaconda作为Python环境或以Python 2.x开头。

I have the same problem. 我也有同样的问题。 I haven't solved it properly, but if I instead create a virtual environment with python 3.6 it works fine..(I would have added this as a comment, but I'm unable to!) 我没有正确解决它,但是如果我改用python 3.6创建一个虚拟环境,它就可以正常工作。(我会把它作为注释添加,但是我做不到!)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入多阵列numpy扩展模块失败(只需使用Anaconda) - Importing the multiarray numpy extension module failed (Just with Anaconda) Python 3.6中的numpy:导入多阵列numpy扩展模块失败 - numpy in Python 3.6: Importing the multiarray numpy extension module failed 为 Windows 10 安装 numpy:导入多数组 numpy 扩展模块失败 - Installing numpy for Windows 10: Importing the multiarray numpy extension module failed 在其他驱动器上导入多阵列numpy扩展模块失败 - Importing the multiarray numpy extension module failed on different drive 导入多阵列 numpy 扩展模块失败。 您很可能正在尝试导入失败的 numpy 构建 - Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy dev_appserver.py app.yaml产生:ImportError:导入多数组numpy扩展模块失败 - dev_appserver.py app.yaml produces: ImportError: Importing the multiarray numpy extension module failed 构建 Python 3.7.1 - SSL 模块失败 - Building Python 3.7.1 - SSL module failed 导入opencv并获取numpy.core.multiarray导入失败 - Importing opencv and getting numpy.core.multiarray failed to import 通过xcode开发的C ++应用程序调用python模块时,numpy.core.multiarray无法导入 - numpy.core.multiarray failed to import while invoking python module through C++ application developed in xcode Visual Studio 2019 - 无法运行 Python 单元测试 - 无法导入测试模块: - Visual Studio 2019 - Cannot run Python unittests - Failed to import test module:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM