Windows:已安装numpy(conda):ModuleNotFoundError

时间:2018-09-21 14:01:50

标签: python python-3.x numpy conda

我在环境中安装了conda numpy,它似乎可以在命令行中运行。

但是,当我运行导入文件时,会得到一个

  

ModuleNotFoundError

这些是我的包裹:

(pandaenv) C:\Users\LorenzKort\OneDrive - ITDS Groep B.V\Documenten\Python>webscraper_test.pyTraceback (most recent call last):
  File "C:\Users\LorenzKort\OneDrive - ITDS Groep B.V\Documenten\Python\webscraper_test.py", line 1, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'
        (pandaenv) C:\Users\LorenzKort\OneDrive - ITDS Groep B.V\Documenten\Python>webscraper_test.pyTraceback (most recent call last):
          File "C:\Users\LorenzKort\OneDrive - ITDS Groep B.V\Documenten\Python\webscraper_test.py", line 1, in <module>
            import numpy as np
        ModuleNotFoundError: No module named 'numpy'

        (pandaenv) C:\Users\LorenzKort\OneDrive - ITDS Groep B.V\Documenten\Python>python
        Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda custom (64-bit) on win32
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import numpy
        >>> numpy
        <module 'numpy' from 'C:\\Users\\LorenzKort\\Miniconda3\\envs\\pandaenv\\lib\\site-packages\\numpy\\__init__.py'>

1 个答案:

答案 0 :(得分:0)

尝试运行pip3 install numpy

另外,尝试使用python3 webscraper_test.py

运行脚本