473,473 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Installing pySerial

Hi All,

Background
===================
I have installed Python for windows today from the python web site .I also
installed pySerial using the Windows installer from the sourceforge web
site..... Both installs use the default directories.

Phyton version : Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC
v.1310 32 bit (Intel)] on win32

pySerial 2.4 July 6th
Problem : Errors Screen output
============================
>>import serial
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import serial
File "C:\Python25\Lib\site-packages\serial\__init__.py", line 18, in
<module>
from serialwin32 import *
File "C:\Python25\Lib\site-packages\serial\serialwin32.py", line 9, in
<module>
import win32file # The base COM port and file IO functions.
ImportError: No module named win32file
>>>
So it looks like Python can not see some of the modules

Here's the active paths
>>print sys.path
['C:\\Python25\\Lib\\idlelib', 'C:\\WINDOWS\\system32\\python25.zip',
'C:\\Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
'C:\\Python25\\lib\\lib-tk', 'C:\\Python25',
'C:\\Python25\\lib\\site-packages']
>>>
It seems that C:\Python25\Lib\site-packages\serial needs to be added to
the PYTHONPATH
QUESTION
=============
Q1. How do I add C:\Python25\Lib\site-packages\serial to the PYTHONPATH ?

Q2. How do I check that I have installed pySerial corretly (using the
Windows installer)

Thanks in advance
Joe



Sep 18 '08 #1
6 10614
Joe G (Home) wrote:
Hi All,

Background
===================
I have installed Python for windows today from the python web site .I also
installed pySerial using the Windows installer from the sourceforge web
site..... Both installs use the default directories.

Phyton version : Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC
v.1310 32 bit (Intel)] on win32

pySerial 2.4 July 6th
Problem : Errors Screen output
============================
>>>import serial

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import serial
File "C:\Python25\Lib\site-packages\serial\__init__.py", line 18, in
<module>
from serialwin32 import *
File "C:\Python25\Lib\site-packages\serial\serialwin32.py", line 9, in
<module>
import win32file # The base COM port and file IO functions.
ImportError: No module named win32file
You need to install the pywin32 extensions from:

http://pywin32.sf.net

They're so commonly used (and, if you install the ActiveState
distro of Python, even bundled) that I imagine many Windows
Pythoneers like myself simply install them automatically as
soon as we've installed the main python.org Python.

Once you've done that, the rest should just work: it's
clear from the traceback that the serial module is getting
imported; it's just trying to find the win32file module.

TJG

Sep 18 '08 #2

"Joe G (Home)" <jo***@optusnet.com.auwrote in message
news:48**********************@news.optusnet.com.au ...
I have installed Python for windows today from the python web site .I also installed
pySerial using the Windows installer from the sourceforge web site.....
You need to read the pySerial smallprint, where it says:

"The files in this package are 100% pure Python. They depend on non standard but
common packages on Windows (pywin32) and Jython (JavaComm).
POSIX (Linux, BSD) uses only modules from the standard Python distribution)"

Sep 18 '08 #3
On 2008-09-18, Joe G (Home) <jo***@optusnet.com.auwrote:
Hi All,

Background
===================
I have installed Python for windows today from the python web site .I also
installed pySerial using the Windows installer from the sourceforge web
site..... Both installs use the default directories.

Phyton version : Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC
v.1310 32 bit (Intel)] on win32

pySerial 2.4 July 6th
Problem : Errors Screen output
============================
>>>import serial

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import serial
File "C:\Python25\Lib\site-packages\serial\__init__.py", line 18, in
<module>
from serialwin32 import *
File "C:\Python25\Lib\site-packages\serial\serialwin32.py", line 9, in
<module>
import win32file # The base COM port and file IO functions.
ImportError: No module named win32file
>>>>

So it looks like Python can not see some of the modules
Do you have the win32 modules installed?
Here's the active paths
>>>print sys.path
['C:\\Python25\\Lib\\idlelib', 'C:\\WINDOWS\\system32\\python25.zip',
'C:\\Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
'C:\\Python25\\lib\\lib-tk', 'C:\\Python25',
'C:\\Python25\\lib\\site-packages']
>>>>

It seems that C:\Python25\Lib\site-packages\serial needs to be added to
the PYTHONPATH
I don't see how you came to that conclusion. Is the "missing"
module (win32file) located in C:\Python25\Lib\site-packages\serial?
QUESTION
=============
Q1. How do I add C:\Python25\Lib\site-packages\serial to the PYTHONPATH ?
Dunno.
Q2. How do I check that I have installed pySerial corretly
(using the Windows installer)
If you used the installer, you almost undoubtedly have it
installed correctly. I think you're missing the win32 package.

http://python.net/crew/mhammond/win32/Downloads.html

--
Grant Edwards grante Yow! I'm not an Iranian!!
at I voted for Dianne
visi.com Feinstein!!
Sep 18 '08 #4
Yep up and running now.

Many thanks

Joe
Sep 19 '08 #5
On Sep 18, 6:01*pm, Tim Golden <m...@timgolden.me.ukwrote:
Joe G (Home) wrote:
Hi All,
Background
===================
I have installed Python for windows today from the python web site *.I also
installed pySerial using the Windows installer from the sourceforge web
site..... Both installs use the default directories.
Phyton *version * *: Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC
v.1310 32 bit (Intel)] on win32
pySerial * 2.4 * July 6th
Problem : *Errors Screen output
============================
>>import serial
Traceback (most recent call last):
* File "<pyshell#0>", line 1, in <module>
* * import serial
* File "C:\Python25\Lib\site-packages\serial\__init__.py", line 18, in
<module>
* * from serialwin32 import *
* File "C:\Python25\Lib\site-packages\serial\serialwin32.py", line 9,in
<module>
* * import win32file *# The base COM port and file IO functions.
ImportError: No module named win32file

You need to install the pywin32 extensions from:

*http://pywin32.sf.net

They're so commonly used (and, if you install the ActiveState
distro of Python, even bundled) that I imagine many Windows
Pythoneers like myself simply install them automatically as
soon as we've installed the main python.org Python.

Once you've done that, the rest should just work: it's
clear from the traceback that the serial module is getting
imported; it's just trying to find the win32file module.
Why are people preferring the python.org package over ActiveState's,
which seems to be more complete and includes more modules (like
pywin32) ?

Eli

Sep 20 '08 #6
En Sat, 20 Sep 2008 02:01:14 -0300, eliben <el****@gmail.comescribió:
Why are people preferring the python.org package over ActiveState's,
which seems to be more complete and includes more modules (like
pywin32) ?
They do a hard work collecting, compiling and packaging the Python
distribution with some added modules. But anything you get in the AS free
version you can get directly from the original authors; downloading
pywin32 from sourceforge isn't so difficult...
And AFAIR, it took about 2 months the guys at ActiveState to release the
2.5 version after it came from python.org

--
Gabriel Genellina

Sep 21 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Bob Greschke | last post by:
We have some equipment that communicates at 57600 baud RS232. The path from the PC is USB to a Phillips USB hub, then off of that a TUSB3410 USB/Serial converter. The driver for the 3410 chip...
4
by: Zarathustra | last post by:
Hi, where I can find the pyserial handbook?? THanks
8
by: Alejandro | last post by:
Hi: I'm using pySerial to talk to a RS232 to RS485 converter. In order to control the converter, I need to control the DTR line to enable/disable de RS485 driver. In particular, I need to : ...
2
by: Jon | last post by:
Hi, I wrote some code to read in info from a port using pyserial. the code reads info sent by a box that is connected to my computer by an rs232-to usb adapter. When I was writing the code and...
3
by: Ron Jackson | last post by:
I am using Python 2.5 on Windows XP. I have installed Pyserial and win32all extensions. When I try to run the example program scan.py (included below), or any other program using pyserial, as...
0
by: pauland80 | last post by:
<snip> <snip> Late thanks for your both answers! (Please excuse me for that) The problem was a bug in the device firmware. But before finding this, I dugg lightly in the pyserial source...
0
by: [david] | last post by:
http://pyserial.sourceforge.net/ "port numbering starts at zero, no need to know the port name in the user program" But the implementation in SerialWin32 is just (Portnum +1)
3
by: naveen.sabapathy | last post by:
Hi, I am trying to use virtual serial ports to develop/test my serial communication program. Running in to trouble... I am using com0com to create the virtual ports. The virtual ports seem to...
2
by: bryanleo | last post by:
We are trying to read data from a microcontroller and interface it through serial port. The output is then displayed in Python using Pyserial or the hyperterminal, the former is more important ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.