Python 2.7.2 的 pyserial
我是 Python 新手。 根据 internets 收到此错误后,我正在寻找模块 pyserial:
ImportError: No module named serial
我首先尝试安装 pywin32,一切顺利。但似乎不含pyserial。 :-(
然后我找到了 pyserial 的单个模块安装程序,我无法安装它,它说它没有在注册表中找到 python 的路径。 :-(
之后我发现 这个模块 在 python.org 上,但我不知道该怎么做,它没有附带安装程序。:-(
如何我可以添加吗在 Windows 7 64 上将 pyserial 转换为 Python (64) 2.7?
I'm new to Python. According to the internets I was looking for the module pyserial after receiving this error:
ImportError: No module named serial
I first tried to install pywin32, it went well. But it seems not to contain pyserial. :-(
Then I found a single module installer for pyserial, I was not able to install it, it says it did not found the path to python in the registry. :-(
After that I found this module on python.org, but I don't know what to do, it does not come with an installer. :-(
How can I add pyserial to Python (64) 2.7 on Windows 7 64?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
你可以用pip试试。 (这里是有关安装的问题/答案)
然后在 shell 中输入:
解决方案:
在 Windows 7 64 上安装 pip 有点棘手:
我将 Python 和 Python/Scripts 路径添加到 PATH 环境中。
然后我以管理员身份打开 PythonWin,从 http://pypi.python.org/pypi/setuptools#downloads 使用 PythonWin。然后我下载了 pip 解压它并以管理员身份运行
python setup.py install< /code> 在 Windows shell 上,然后
pip install pyserial
。You could try it with pip. (Here a question/answer about installing it)
Then type in your shell:
Solution:
The installation of pip on Windows 7 64 is a little tricky:
I added my Python and Python/Scripts path to the PATH env.
Then I opened PythonWin as Administrator, ran ez_setup.py from http://pypi.python.org/pypi/setuptools#downloads with PythonWin. And then I downloaded pip unpacked it and as Administrator I ran
python setup.py install
on the windows shell and after thatpip install pyserial
.来自http://www.instructables。 com/id/The-Arduino-Internet-Gizmo/step19/Installing-the-software/
安装 pySerial,如下所示:
从 http://pypi.python.org/pypi/pyserial - 单击 pyserial-2.6.tar。 gz 下载库。
运行 7-Zip(开始 -> 所有程序 -> 7-Zip -> 7-Zip 文件管理器)。
使用 7-Zip 打开 pyserial-2.6.tar.gz 文件(文件 -> 打开)。
双击“dist”文件夹。
单击“pyserial-2.6.tar”文件,然后单击窗口顶部的“提取”按钮。当询问将文件放在哪里时,请指定
c:\Python27\Lib\site-packages\pyserial-2.6
从 7-Zip 退出
现在您已经下载了 pySerial,请安装它:
打开命令窗口 (开始 -> 所有程序 -> 附件 -> 命令提示符)并在命令行中输入: c:\Python27\Lib\site-packages\pyserial-2.6
通过键入以下命令(包括路径)安装 pySerial:
c:\Python27\python.exe setup.py install
From http://www.instructables.com/id/The-Arduino-Internet-Gizmo/step19/Installing-the-software/
Install pySerial as follows:
Download pySerial from http://pypi.python.org/pypi/pyserial - click on pyserial-2.6.tar.gz to download the library.
Run 7-Zip (Start -> All Programs -> 7-Zip -> 7-Zip File Manager).
Open the pyserial-2.6.tar.gz file with 7-Zip (File -> Open).
Double click the "dist" folder.
Single click on the "pyserial-2.6.tar" file and click the "Extract" button at the top of the window. When asked where to put the file, specify
c:\Python27\Lib\site-packages\pyserial-2.6
Exit from 7-Zip
Now that you have downloaded pySerial, install it:
Open a command window (Start -> All Programs -> Accessories -> Command Prompt) and type into the command line:
cd c:\Python27\Lib\site-packages\pyserial-2.6
Install pySerial by typing this command (including the path):
c:\Python27\python.exe setup.py install
我知道这个问题是针对 Windows 的,但由于它首先出现在 Google 搜索中,让我为 Debian 添加一个替代方案(pip):
sudo apt-get install python-serial
understood that this question is for Windows, but since it comes up first in a Google search let me add an alternative (to pip) for Debian:
sudo apt-get install python-serial
作为一个小更新,仍然存在 python 64bit for Windows 与 pyserial 安装程序不兼容的问题。
其他答案中没有提到,但我发现知道这一点非常有用:Python 32 位 在 Win7 64 位上安装并运行良好,这意味着 pyserial 安装程序也可以正常运行。
显然,如果你需要 64 位 python,这对你来说没有用,但我怀疑我们大多数人都不需要。
As a slight update there is still the problem that python 64bit for Windows is not compatible with the pyserial installer.
What is not mentioned in other answers but I found very useful to know is that Python 32 bit installs and works fine on Win7 64bit and that means the pyserial installer also works fine.
Obviously if you need 64bit python this is no use to you, but I suspect most of us do not.
请访问 http://www.lfd.uci.edu/~gohlke/ pythonlibs/#pyserial 并下载 64 位安装程序,仅此而已!
please just go to http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyserial and download the 64 bit installer and that's it!
恢复旧线程,但 pyserial v3.4 现在可通过 conda-forge 频道上的 conda 包管理器用于 windows/mac/linux
(基本 conda 通道有 v2.7)
要使用 conda 运行安装此软件包:
conda install -c conda-forge pyserial
reviving an old thread but pyserial v3.4 is now available for windows/mac/linux via the conda package manager on the conda-forge channel
(the base conda channel has v2.7)
To install this package with conda run:
conda install -c conda-forge pyserial
pyserial 现在附带预编译的(?)Windows .exe 安装程序: https://pypi.python.org/pypi /pyserial
pyserial comes now with a precomilied(?) Windows .exe installer: https://pypi.python.org/pypi/pyserial
pySerial 可以从 PyPI 安装:
注意:使用所需版本 (2.7/3.x) 的 python/python3 可执行文件。
pySerial can be installed from PyPI:
NOTE : Using the python/python3 executable of the desired version (2.7/3.x).
我在这里找到 2.7 安装文件
https://pypi.org/project/pyserial/2.7/ #文件
I find the 2.7 installation files here
https://pypi.org/project/pyserial/2.7/#files