简体   繁体   English

python-serial发生了什么?

[英]What has happened to python-serial?

I have had replace an old PI2B, Jessie, Python 2.7, which satisfactorily ran some python code, with PI3B, Buster, Python 3.7, but I now cannot find/load python-serial. I have had replace an old PI2B, Jessie, Python 2.7, which satisfactorily ran some python code, with PI3B, Buster, Python 3.7, but I now cannot find/load python-serial. 'sudo apt-get install python-serial' installs it but when my python code is run it reports it as missing and 'sudo pip install python-serial' can't install it and comes back with the error below. 'sudo apt-get install python-serial' 安装它,但是当我的 python 代码运行时,它报告它丢失并且'sudo pip install python-serial' 无法安装它并返回以下错误。 Has it been replaced/superseded?是否已被替换/取代? What can I do to enable 'import serial' to work?我该怎么做才能使“导入序列”起作用? Thanks谢谢

Looking in indexes: https://pypi.org/simple , https://www.piwheels.org/simple Collecting python-serial Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/python-serial/" Blockquote Looking in indexes: https://pypi.org/simple , https://www.piwheels.org/simple Collecting python-serial Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https:/ /pypi.org/simple/python-serial/" 块引用

Python 2's python-serial is Python 3's python3-serial (note the python3 ) It can be installed from buster repositories as of this post. Python 2 的python-serial是 Python 3 的python3-serial (注意python3 )从这篇文章开始,它可以从 buster 存储库安装。

It can also be installed from pip here:也可以从pip安装:

pip3 install pyserial

If pip is not available on the machine then it can be installed from source:如果 pip 在机器上不可用,则可以从源安装:

https://github.com/pyserial/pyserial/releases https://github.com/pyserial/pyserial/releases

Download the archive, extract it and install it with:下载存档,解压缩并安装:

python setup.py install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM