我在环境中安装了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'>
答案 0 :(得分:0)
尝试运行pip3 install numpy
另外,尝试使用python3 webscraper_test.py