Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 3rd, 2013, 05:45 PM
dayo30 dayo30 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 4 dayo30 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #2  
Old January 3rd, 2013, 06:48 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is online now
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,389 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 14 h 22 m 25 sec
Reputation Power: 383
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!

Reply With Quote
  #3  
Old January 4th, 2013, 09:53 PM
dayo30 dayo30 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 4 dayo30 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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?

Reply With Quote
  #4  
Old January 7th, 2013, 02:08 PM
dayo30 dayo30 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 4 dayo30 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Trying to use PySerial, get the following:

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap