简体   繁体   English

python3 ImportError:Windows10上没有名为“ numpy”的模块

[英]python3 ImportError: No module named 'numpy' on windows10

I have a problem with importing the 'numpy' package in python. 我在python中导入'numpy'软件包时遇到问题。 I'm currently using python3.4.5 in anaconda3. 我当前在anaconda3中使用python3.4.5。 But when I try to run the following code, 但是当我尝试运行以下代码时,

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

I get the following error message. 我收到以下错误消息。

Traceback (most recent call last):
  File "D:/SourceCodes/PycharmSources/trial/titanic.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Anaconda3\envs\py34\lib\site-packages\matplotlib\__init__.py", line 122, in <module>
    from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label
  File "C:\Anaconda3\envs\py34\lib\site-packages\matplotlib\cbook.py", line 32, in <module>
    import numpy as np
ImportError: No module named 'numpy'

Well, I've tried uninstalling/reinstalling the numpy and pandas libraries using both the 好吧,我尝试使用以下两种方法卸载/重新安装numpy和pandas库:

pip uninstall numpy / pip insatll numpy
conda install -f numpy

commands, but nothing seems to solve my problem. 命令,但似乎无法解决我的问题。

Thank you in advance. 先感谢您。

See my answer here 在这里查看我的答案

After trying many suggestions from various sites and similar questions, what worked for me was to uninstall all Python stuff and reinstall Anaconda only. 在尝试了来自各个站点的许多建议和类似问题之后,对我有用的是卸载所有Python东西并仅重新安装Anaconda。 The previous Python installation I had was not only redundant but only caused me trouble. 我以前的Python安装不仅多余,而且还给我带来了麻烦。

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

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