简体   繁体   中英

installing and using pyserial in python 3.4 windows 8.1

I want to use pyserial but I do not know what I am doing wrong

I have installed python 3.4.2 from this link www-python-org-downloads-release-python-342- the one that says "Windows x86-64 MSI installer" and I got this archive "python-3.4.2.amd64.msi" because my operating system is 64 bit during the installation I have selected "add python.exe to path" (will be installed on local hard drive), and all the other ones

I went to the pyserial website http://pyserial.sourceforge.net/pyserial.html#installation which say "Download the archive from http://pypi.python.org/pypi/pyserial . Unpack the archive, enter the pyserial-xy directory and run:" and sent me to this link http-pypi-python-org-pypi-pyserial

I have donwloaded from this link, these three archives pyserial-2.7.tar.gz, pyserial-2.7.win32.exe pyserial-2.7.win32_py3k.exe

I have tried to run the .exe one but they say "No python installation found in the registry", which I dont know why

then I unpack the .gz file with Winrar enter into the folder and try to run "pyserial-xy" but there is nothing like that in this folder in this folder I can find

documentation (folder)
examples
serial
test
CHANGES.txt
LICENSE.txt
MANIFEST.in
PKG-INFO
README.txt
setup.py

I tried to run this "setup.py" but for a second a black window appears

detected Python 3, using 2to3
C;\Python34\lib\distutils\dist.py:260: UserWarning: Unknow distribution option: use_2to3
warning.warn(msg)
usage: setup.py [global_opts] [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help commands
or: setup.py cmd --help
error: no commands supplied

and then disappears

I went to the command prompt and wrote "python3 setup.py install" or python setup.py install but it says Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\\Users\\me>python3 setup.py install 'python3' is not recognized as an internal or external command operable program or batch file.

so I cant do that either

then in command prompt I chancge the directory with "cd C:\\Users\\me\\Downloads\\pyserial-2.7" which is the place where the folder .gz is then "python setup.py install" and "python3 setup.py install" but they do not work there is the code and at the end it says

C:\Users\me\Downloads\pyserial-2.7>python setup.py install
Detected Python 3, using 2to3
C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option:
 'use_2to3'
  warnings.warn(msg)
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
running install_egg_info
Removing C:\Python34\Lib\site-packages\pyserial-2.7-py3.4.egg-info
Writing C:\Python34\Lib\site-packages\pyserial-2.7-py3.4.egg-info
C:\Users\me\Downloads\pyserial-2.7>

then I try to write in the command prompt "python" then "import serial" but still it does not work

THEN i DO NOT KNOW WHAT TO DO

could somebody help me

well actually it is working, the last part of my question "last code" says that the installation was successful

sorry to bother

so in order to clarify this issue I will write the whole process, Please recommend this post to all the people who is having the same issue, IT WAS SO ANNOYING without A CLEAR PROCESS

  1. first download Python 3.4.2, install it
  2. then download pyserial "pyserial-2.7.tar.gz"
  3. unzip with Winrar
  4. go to command prompt
  5. change the directory means write "cd C:\\Users\\me\\Downloads\\pyserial-2.7>" which is the inside of the unzipped folder, or wherever you unzipped the pyserial.gz
  6. then write "python setup.py install"
  7. in the installation process activate the last option, use in the local disk

done

As there are multiple issues with your installation, I recommend you start fresh by do the following:

  1. Uninstall the 64bit version of Python, reboot your computer.
  2. Download and install the 32bit MSI installer from python.org

A lot of libraries are already compatible with Python 3, but not everything is there yet and you don't want to run into issues during development; so I would recommend the latest 2.7.x version.

  1. Download and install the setuptools package .
  2. Download the file pyserial-2.7.win32.exe and then double click it to run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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