简体   繁体   English

spyder 上没有名为 numpy 的模块

[英]No module named numpy on spyder

I've checked pretty much every solution available online and none have worked for me, so I'm resorting to asking my own question.我已经检查了几乎所有在线可用的解决方案,但没有一个对我有用,所以我求助于自己的问题。 To offer some background I'm writing a GUI in pyqt that needs to connect to serial to take voltages off an instrument we have in our lab.为了提供一些背景知识,我正在 pyqt 中编写一个 GUI,它需要连接到串行设备以从我们实验室的仪器上取下电压。 Anyways, these voltages will read out as an array, so I'm attempting to use the numpy module to help me with this, but for some reason it's saying the module is not found.无论如何,这些电压将作为一个数组读出,所以我尝试使用 numpy 模块来帮助我解决这个问题,但由于某种原因,它说找不到该模块。 The IDE I am using is Spyder.我使用的 IDE 是 Spyder。 I've tried everything from pip3 install numpy to conda install numpy to uninstalling numpy and reinstalling it and nothing has worked.我已经尝试了从 pip3 install numpy 到 conda install numpy 到卸载 numpy 并重新安装它的所有方法,但没有任何效果。 Please let me know if anyone has any suggestions for this.如果有人对此有任何建议,请告诉我。 Thanks!谢谢!

I normally use anaconda and in an anaconda virtual environment, I type the following commands:我通常使用 anaconda 并在 anaconda 虚拟环境中输入以下命令:

pip install numpy
pip install spyder
spyder

This should open your spyder app and any code you write should be able to import and use numpy successfully.这应该会打开您的 spyder 应用程序,并且您编写的任何代码都应该能够成功导入和使用 numpy。 Hope this helps.希望这可以帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM