pyserial issue.

I’m trying to get pyseial working so I can control a panda world via serial input. I can pyserial working in my python2.4 directory, but when I transfer the pyserial files, and win32com files, to my panda ‘C:\Panda3D-1.3.2\python\Lib\site-packages’ directory it dosn’t work, and says it can’t find the win32file object.

Is there another way to get information from a serial port other than pyserial?

Or from the above error, does someone know the way to get pyserial working within the panda context. Maybe I missed something on the tranfer from python to panda.

thanks.

The win32 extensions are a rather complex package. Might be you didn’t move everything to the Panda3d-Python. There should be a file “pywin32-wininst.log” in the Python directory where you installed it. You could check if you moved everything using this file.

Also pywin32 depends on the windows registry. So perhaps it would be the best if you try to register the Python version that comes with Panda3D with Windows, and then use the binary installer to install pywin32 in the Panda3D directories. I think I have seen such a script on Fredrik Lundh’s site (aka effbot) some years ago. Not sure if it is still there and works with current Python versions, but perhaps worth a try.

enn0x

I found the script again:
http://effbot.org/zone/python-register.htm

Register works on my machine, after removing old Python 2.4 keys from the registry by hand. But installing pywin32 to Panda3D site-packages gives errors, related to that part of pywin32 that is installed in C:\WINDOWS. A conflict with another installation of pywin32 on my machine, for Python 2.5.

So better not try this second approach.

enn0x

thanks enn0x. I went through and looked at the log of the win32 installation. I had copied across the files correctly. Then went and got the source files for the win32 extensions, rather than using the win installer, and in these there was a pywin32.pth file, to direct to: win32, win32\lib, Pythonwin.

By simply copying this .pth file into the panda ‘site-packages’ directory the problem was solved, and am able now able to access the serial port within panda.