Android PySerial Python错误:AttributeError:';串行';对象没有属性'_端口u手柄';

Android PySerial Python错误:AttributeError:';串行';对象没有属性'_端口u手柄';,android,python,tornado,pyserial,Android,Python,Tornado,Pyserial,我尝试用HTML和JavaScript与Python进行串行通信。 背景是,我需要一个Android上的接口来控制连接到平板电脑或手机USB端口的串行设备。我做过网页设计,用HTML、CSS、JS构建界面对我来说很容易。 也许有更好的方法(?),但我发现的唯一例子是: 所以我安装了: Visual C++ 2008 SP1 Redistributable Package Eng (x86) Visual C++ 2008 SP1 Redistributable Package Eng (x64

我尝试用HTML和JavaScript与Python进行串行通信。 背景是,我需要一个Android上的接口来控制连接到平板电脑或手机USB端口的串行设备。我做过网页设计,用HTML、CSS、JS构建界面对我来说很容易。 也许有更好的方法(?),但我发现的唯一例子是:

所以我安装了:

Visual C++ 2008 SP1 Redistributable Package Eng (x86)
Visual C++ 2008 SP1 Redistributable Package Eng (x64)
Visual C++ Compiler for Python 2.7 v9.0.0.30729 Eng
Python x86 v2.7.11
在CMD中:

python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade virtualenv
python -m pip install --upgrade wheel
python -m pip install --upgrade pyserial
python -m pip install --upgrade tornado
python -m pip install --upgrade multiprocessing
我从这方面得到的例子的问题是:

AttributeError: 'Serial' object has no attribute '_port_handle'

因为我从来没有对Python做过太多的工作-我迷路了。

我也遇到了同样的问题,因为多处理库启动了一个新进程,并且无法访问主进程创建的串行对象,所以示例代码似乎无法工作

要解决此问题,请执行以下操作:

serialworker.py
文件中,将
self.sp=serial.serial(serial\u PORT,serial\u BAUDRATE)
行从
\uuu init\uuuuuuuuu
函数移动到
run
函数的第一行