您尚未登录。

楼主 #1 2020-07-10 14:49:07

Gentlepig
会员
注册时间: 2018-10-24
已发帖子: 1,378
积分: 1343.5

win10下报错:no module named termios

python有pty这个模组可以创建虚拟串口,结果在win10下执行import pty,结果报错:

>>> import pty
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python\Python36\lib\pty.py", line 11, in <module>
    import tty
  File "C:\Python\Python36\lib\tty.py", line 5, in <module>
    from termios import *
ModuleNotFoundError: No module named 'termios'

搜了下,说termios是Linux下用到的,win10没用。但我win10报这个错误该如何解决?

最近编辑记录 Gentlepig (2020-07-10 14:49:45)

离线

#2 2020-07-10 14:57:29

路人甲
会员
注册时间: 2017-09-07
已发帖子: 202
积分: 199.5

Re: win10下报错:no module named termios

离线

楼主 #3 2020-07-10 15:57:41

Gentlepig
会员
注册时间: 2018-10-24
已发帖子: 1,378
积分: 1343.5

Re: win10下报错:no module named termios

> pip search termios
pycopy-termios (0.0.0)       - Dummy termios module for Pycopy        
micropython-termios (0.0.0)  - Dummy termios module for MicroPython 

搜到了两个相关的,不过感觉应该不是。

搜pty发现如下:
The pty module defines operations for handling the pseudo-terminal concept: starting another process and being able to write to and read from its controlling terminal programmatically.
Because pseudo-terminal handling is highly platform dependent, there is code to do it only for Linux. (The Linux code is supposed to work on other platforms, but hasn’t been tested yet.)
如果pty在win下不能用的话,那么win10下有没有其它的python可用的可创建虚拟串口的模组?

最近编辑记录 Gentlepig (2020-07-10 16:00:00)

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn