即使已安装,也无法导入PySerial

I'm trying to import PySerial import serial, but i get a ModuleNotFoundError: No module named 'serial'. I installed PySerial via conda install pyserial and I also tried with pip install pyserial in both cases I get the same error, but if execute conda list or pip list pyserial appears in the list. I'm using VS Code on Windows and unistalled and reinstalled Anconda, VS Code and PySerial serveral times. I checked also, that there is not the serial package.

Can anybody tell me why I can not import serial?

评论
失忆症
失忆症

可能您没有运行您认为的python版本。

Find full path of the Python interpreter?

尝试:

 import sys
 print(sys.executable)

并查看它是否符合您的期望。

点赞
评论