[err] Traceback (most recent call last):
[err] File "main.py", line 900, in ?
[err] File "autotest1.py", line 1, in ?
[err] File "E:\movpy-2.0.0-demo-py2.3.5\movpy\MyScripts
\pb_comms.py", line 28, in ?
[err] File "E:\movpy-2.0.0-demo-py2.3.5\movpy\lib\Lib\site-packages
\serial\__init__.py", line 13, in ?
[err] File "E:\movpy-2.0.0-demo-py2.3.5\movpy\lib\Lib\site-packages
\serial\serialwin32.py", line 9, in ?
[err] ImportError: DLL load failed: The specified procedure could not
be found.
I have Python 2.3 installed on my desktop under WinXP and use pyserial
successfully for serial communicatons there.
I suspect an installation problem perhaps due to the difference in
locations for extensions or something to do with windows. I found the
info under "customizing" on the voidspace site, but unfortunately, I
am unable figure out what to do.
I did try to install it again and see the files directly under ..\movpy
\lib\serial but the above seems to indicate its looking for ..\movpy
\lib\Lib\site-packages
For what its worth, my use case is to move a working program from my
desktop to a laptop doing data collection in the lab. Presently, I am
using the demo pack, but my intent was to purchase it if I can show
that it works.
Can someone please help ? Thanks and regards.
It may work :-)
On the other hand - it is possible that those error messages are coming
from '.pyc' files which hard code a path inside them (it could be a
relative path). Try removing those and seeing if the error message changes.
Is there a test program I can run without a serial device attached? That
way I can experiment this end.
Michael
http://www.voidspace.org.uk/python/articles.shtml
I found that Lib\site-packages was in the directory AND already in the
sys.path as well.
So I moved on to trying to delete the .pyc files
The error changed to show it looking in \lib\serial (see below)
Below is a very small test program (test_pyserial.py) that doesn't
need a serial device attached:
# pyserial test program
# Open port 0 at "9600,8,N,1", no timeout
import serial
ser = serial.Serial(0) #open first serial port
print "\nPort opened: ",ser.portstr #check which port was really
used
ser.close() #close port
print "Should be closed now"
What I get now is:
[err] Traceback (most recent call last):
[err] File "main.py", line 900, in ?
[err] File "test_pyserial.py", line 4, in ?
[err] File "E:\movpy-2.0.0-demo-py2.3.5\movpy\lib\serial
\__init__.py", line 13, in ?
[err] File "E:\movpy-2.0.0-demo-py2.3.5\movpy\lib\serial
\serialwin32.py", line 9, in ?
[err] ImportError: DLL load failed: The specified procedure could not
be found.
If its helpful, the pyserial website is here: http://pyserial.sourceforge.net/
By the way, I can use the interpreter ">>>", but the IDE doesn't seem
to work...
Thanks in advance.
On Jul 31, 1:34 pm, Michael Foord <fuzzy...@voidspace.org.uk> wrote:
> Hmmm... How about trying to create a 'Lib/site-packages' folder in the
> lib directory (as it looks like that is where it is looking), add it to
> sys.path at the start of your app. and try that.
>
> It may work :-)
>
> On the other hand - it is possible that those error messages are coming
> from '.pyc' files which hard code a path inside them (it could be a
> relative path). Try removing those and seeing if the error message changes.
>
> Is there a test program I can run without a serial device attached? That
> way I can experiment this end.
>
> Michaelhttp://www.voidspace.org.uk/python/articles.shtml
> > Can someone please help ? Thanks and regards.- Hide quoted text -
>
> - Show quoted text -
I'm out now until Friday, but I promise to look at the problem than and
see what I can come up with.
I vaguely wonder if pyserial puts DLLs (or '.pyd's) in funny places and
maybe you aren't copying them across. Or maybe the serial directory
needs to be added to the path as well.
These are all things I can look at on Friday though.
Michael
On Jul 31, 1:25 pm, pete <peste...@nordson.com> wrote:
> [err] Traceback (most recent call last):
> [err] File "main.py", line 900, in ?
> [err] File "test_pyserial.py", line 4, in ?
> [err] File "E:\movpy-2.0.0-demo-py2.3.5\movpy\lib\serial
> \__init__.py", line 13, in ?
> [err] File "E:\movpy-2.0.0-demo-py2.3.5\movpy\lib\serial
> \serialwin32.py", line 9, in ?
> [err] ImportError: DLL load failed: The specified procedure could not
> be found.
What's on line 9 of serialwin32.py?
BTW, I think removing compiled (.pyc, .pyo) files is a good idea
whenever you copy over a module to Movable Python from another
distribution.
-Jim C.
I see, it's importing a .pyd file from the win32 extensions. This
sounds very familiar, this thread might be helpful:
<http://groups.google.com/group/movpy/browse_thread/thread/
4186e56692014bed/2e379e9c86bd9e38?lnk=gst&q=import
+win32api&rnum=1&hl=en#2e379e9c86bd9e38>
I see, it's importing a .pyd file from the win32 extensions. This
I see, it's importing a .pyd file from the win32 extensions. This
I see, it's importing a .pyd file from the win32 extensions. This
-Jim
On my desktop, in WINDOWS\SYSTEM32 I find:
python23.dll version 2.3.2150.1013
pythoncom23.dll version 2.3.2.163 <----------- build 163?
On my USB stick I find
movpy\python23.dll
movpy\lib\pythoncom23.dll version 2.3.210.0 <------ from
http://pywin32.sourceforge.net
JimC: I searched the group as you suggested. I couldn't follow all
the discussion, but I added these 3 lines to the start of my program
import pywintypes
import pythoncom
import win32api
and it works now. Thanks JimC ! But I don't understand why... or if
this is the best way. It wasn't required on my desktop.
I appreciate any help or explanation (knowledge!) anyone might
provide.
Regards,
Pete
As you might guess build 210 is much more recent than build 163. Having
to do the imports in that specific order is just a peculiarity of the
pywin32 extensions - the dlls must be loaded in the correct order for
some reason when running with Movable Python or any program created with
py2exe.
I'm glad it has been sorted though. (And thanks for the responses Jim.)
Michael
http://www.voidspace.org.uk/python/articles.shtml
Can you provide guideliness for when to do this? Is it only related
to py2exe or something else? Thanks !
Pete
>
> > Regards,
> > Pete
>
> > On Aug 1, 1:14 pm, JimC <jacli...@mailbolt.com> wrote:
>
> >> Blast, sorry for the multiple posts and broken URL. Probably easier to
> >> search the group for "import win32api".
>
> >> -Jim- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
On Aug 2, 9:13 am, pete <peste...@nordson.com> wrote:
>
> > > import pywintypes
> > > import pythoncom
> > > import win32api
>
> > As you might guess build 210 is much more recent than build 163. Having
> problems (and avoid taking anyone's time) when moving programs. I now
> understand that the *order* of imports is important. What I don't
> understand is that on my desktop, *none* of the three imports were
> needed. Is it just that they're needed and used anyway (unbeknownst
> to me) and by specifying them I control the order? Or is it that the
That's right. And furthermore, at some point they try to find one more
more dlls (e.g. python23com.dll). For reasons that I don't understand,
if you explicitly do the import in your Python code it finds the
correct dll, whereas if you allow the import to happen indirectly in
a .pyd module it finds the one in your system directory. Which is a
different version.
Michael might have some notion about why this happens and how it
relates to whether or not sys.frozen is defined, I just stumbled
across it.
The imports may not all three be necessary, you might try leaving out
win32api.
-Jim
This is a specific problem with the pywin32 extensions. It took quite a
long time to track down - but the solution (odd as it is) seems to work.
As I mentioned, it is not a problem specific to Movable Python, but can
affect other programs created with py2exe as well.
In *general* this is the only problem of its kind that I'm aware of.
There are a few other minor differences between the Movable Python and
the CPython environment, a few of which are noted here:
http://www.voidspace.org.uk/python/movpy/ISSUES.html
All the best,
Michael
http://www.ironpython.info/