Installing pySerial

J

Joe G \(Home\)

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
============================
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
['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
 
T

Tim Golden

Joe said:
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
============================
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
 
R

Richard Brodie

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)"
 
E

eliben

Joe said:
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
============================
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
 
G

Gabriel Genellina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top