943,778 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 8670
  • Python RSS
Oct 30th, 2008
0

importing PYD files

Expand Post »
You'll have to excuse me, I'm a complete python newbie, but am trying to import a pyd file that I've been sent by a friend. He assures me the file works fine on his computer but when I run
Python Syntax (Toggle Plain Text)
  1. import myfile.pyd
, after having placed the pyd file in the c:\Python\DLLs folder and added the directory to the environment variable, I get the following error

"ImportError: DLL load failed: The specified module could not be found."

I've tried other PYD files from the same directory and they work, so I don't think it's a problem with the directory. Would it matter if my friend compiled this on a different version of Python?

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dh273 is offline Offline
4 posts
since Jan 2008
Oct 30th, 2008
0

Re: importing PYD files

Can you try just import myfile , without the .pyd?
Reputation Points: 355
Solved Threads: 292
Veteran Poster
jlm699 is offline Offline
1,102 posts
since Jul 2008
Oct 30th, 2008
0

Re: importing PYD files

I've tried that and I get the same error message. Any thoughts?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dh273 is offline Offline
4 posts
since Jan 2008
Oct 30th, 2008
0

Re: importing PYD files

try this before the import

Python Syntax (Toggle Plain Text)
  1. import sys
  2. sys.path.append("c:\Python\DLLs")
Reputation Points: 31
Solved Threads: 7
Light Poster
tyincali is offline Offline
45 posts
since Oct 2008
Oct 30th, 2008
0

Re: importing PYD files

It could be an issue with the python versions, but that isn't usually the error you get when that is the case.
Reputation Points: 31
Solved Threads: 7
Light Poster
tyincali is offline Offline
45 posts
since Oct 2008
Oct 30th, 2008
0

Re: importing PYD files

Excellent - it's now working. Thanks very much for your help, guys
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dh273 is offline Offline
4 posts
since Jan 2008
Oct 30th, 2008
0

Re: importing PYD files

what was the solution?
Reputation Points: 31
Solved Threads: 7
Light Poster
tyincali is offline Offline
45 posts
since Oct 2008
Jan 1st, 2012
0
Re: importing PYD files
Click to Expand / Collapse  Quote originally posted by tyincali ...
what was the solution?
The pyd file must be somewhere in the PYTHONPATH.
So adding the folder like suggested above, did actually added the "DLL" folder to the python path
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tsmets is offline Offline
5 posts
since Oct 2009
Message:
Previous Thread in Python Forum Timeline: IndexError in reading a CSV into a multidimensional array
Next Thread in Python Forum Timeline: How are these keywords used?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC