The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
Trying to use PySerial, get the following:
Discuss Trying to use PySerial, get the following: in the Python Programming forum on Dev Shed. Trying to use PySerial, get the following: Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 3rd, 2013, 05:45 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 4
Time spent in forums: 2 h 2 m 41 sec
Reputation Power: 0
|
|
|
Trying to use PySerial, get the following:
Windows 7 32-bit, Python 2.7.3, PySerial installed by pyserial-2.5.win32.exe
Trying to use PySerial, get the following:
>>> import serial
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "F:\Python27\lib\site-packages\serial\__init__.pyw", line 19,
in <module> from serialwin32 import *
File "F:\Python27\lib\site-packages\serial\serialwin32.pyw", line 11,
in <module> import ctypes
File "F:\Python27\lib\ctypes\__init__.py", line 10, in <module>
from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes
>>>
serial, and ctypes are listed as install modules.
The exe installed the folder ctypes in a sub-folder of Python 27\Lib,
and the folder serial in Python\Lib\site-packages.
>>> import sys
>>> print sys.path
['',
'C:\\Windows\\system32\\python27.zip',
'F:\\Python27\\DLLs',
'F:\\Python27\\lib',
'F:\\Python27\\lib\\plat-win',
'F:\\Python27\\lib\\lib-tk',
'F:\\Python27\\Lib\\site-packages\\pythonwin',
'F:\\Python27',
'F:\\Python27\\lib\\site-packages',
'F:\\Python27\\lib\\site-packages\\win32',
'F:\\Python27\\lib\\site-packages\\win32\\lib']
>>>
I've searched with Google, and the forums, and found nothing of any help.
|

January 3rd, 2013, 06:48 PM
|
 |
Contributing User
|
|
|
|
|
I just tried python 2.4 on a windows computer.
import ctypes
import sys
print(sys.modules)
...
_ctypes.pyd is in site-packages.
Although in recent pythons ctypes is part of the distribution. Should be, at least.
on linux system
python2.7/lib-dynload/_ctypes.so
reinstall your python?
__________________
[code] Code tags[/code] are essential for python code!
|

January 4th, 2013, 09:53 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 4
Time spent in forums: 2 h 2 m 41 sec
Reputation Power: 0
|
|
|
Thanks for your answer. I will investigate that.
I have found that, when one program attempts to import another program, it invariably fails.
Since I seem to be the only one who has problems with these (downloaded) programs , I am inclined to think that it may have something to do with a path setting,.
As a Python beginner, I may have a bad setting.
Maybe someone could look at my path settings, listed in my first post?
|

January 7th, 2013, 02:08 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 4
Time spent in forums: 2 h 2 m 41 sec
Reputation Power: 0
|
|
|
[solved]
[QUOTE=b49P23TIvg
Although in recent pythons ctypes is part of the distribution.
reinstall your python?[/QUOTE]
Good call, thanks.
I finally got time to uninstall, and reinstall Python, and all packages. I also realized that my directory structure was "less than optimal".
Now that problem is solved, and now I have a couple of new ones but, since they are different, I will make a new thread if I can't solve them.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|