虽然已安装,但找不到numpy模块,但导入numpy可以工作

2024-09-28 18:54:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我想运行导入numpy模块的python脚本

当我试图运行时,它会给我错误,因为找不到numpy模块

C:\BSW_development\bp_plarp\Tools\PicoScope>test_pwm.py
Traceback (most recent call last):
  
File "C:\BSW_development\bp_plarp\Tools\PicoScope\test_pwm.py", line 24, in <module>
    from lib_pico2000a import ScopeCapture

File "C:\BSW_development\bp_plarp\Tools\PicoScope\lib_pico2000a.py", line 20, in <module>

    import numpy as np                                      # linspace
ModuleNotFoundError: No module named 'numpy'

虽然它正在安装

C:\BSW_development\bp_plarp\Tools\PicoScope>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> import numpy
>>> numpy.version.version
'1.19.5'
>>> exit()`

Tags: 模块pytestimportnumpylinetoolsfile