serial I/O install fail -- DLL not found

Discussion in 'Python' started by Fossil, Nov 1, 2010.

  1. Fossil

    Fossil Guest

    Just starting with Python.
    Installed:
    Python 2.7
    pywin32-214.win32-py2.7.exe
    pyserial-2.5.win32.exe
    on a Home WinXP SP3 Toshiba laptop with 2GB memory. Open Python and
    try to do simple I/O test and can't even get past first line.
    Transcript below. You will see that
    __name__ is defined as '__main__"
    but path is not defined. Could this be due to creating the folder
    holding the Python.exe being on the E: drive or for some other obscure
    reason? The DOS path environmental variable includes:
    e:\Program Files\Python27
    Thanks in advance for for any help.
    **********transcript*************

    Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit
    (Intel)] on win
    32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from uspp import *

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "E:\Python27\lib\uspp.py", line 189, in <module>
    from SerialPort_win import *
    File "E:\Python27\lib\SerialPort_win.py", line 54, in <module>
    from win32file import *
    File "E:\Python27\lib\win32file.py", line 12, in <module>
    __load()
    File "E:\Python27\lib\win32file.py", line 10, in __load
    mod = imp.load_dynamic(__name__, path)
    ImportError: DLL load failed: The specified module could not be found.
    >>> path

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    NameError: name 'path' is not defined
    >>> __name__

    '__main__'
    >>>
     
    Fossil, Nov 1, 2010
    #1
    1. Advertising

  2. On Mon, Nov 1, 2010 at 5:55 PM, Fossil <> wrote:
    > Just starting with Python.
    > Installed:
    >  Python 2.7
    >  pywin32-214.win32-py2.7.exe
    >  pyserial-2.5.win32.exe
    > on a Home WinXP SP3 Toshiba laptop with 2GB memory.  Open Python and
    > try to do simple I/O test and can't even get past first line.
    > Transcript below.  You will see that
    > __name__ is defined as '__main__"
    > but path is not defined.  Could this be due to creating the folder
    > holding the Python.exe being on the E: drive or for some other obscure
    > reason?  The DOS path environmental variable includes:
    > e:\Program Files\Python27
    > Thanks in advance for for any help.
    > **********transcript*************
    >
    > Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit
    > (Intel)] on win
    > 32
    > Type "help", "copyright", "credits" or "license" for more information.
    >>>> from uspp import *

    > Traceback (most recent call last):
    >  File "<stdin>", line 1, in <module>
    >  File "E:\Python27\lib\uspp.py", line 189, in <module>
    >    from SerialPort_win import *
    >  File "E:\Python27\lib\SerialPort_win.py", line 54, in <module>
    >    from win32file import *
    >  File "E:\Python27\lib\win32file.py", line 12, in <module>
    >    __load()
    >  File "E:\Python27\lib\win32file.py", line 10, in __load
    >    mod = imp.load_dynamic(__name__, path)
    > ImportError: DLL load failed: The specified module could not be found.
    >>>> path

    > Traceback (most recent call last):
    >  File "<stdin>", line 1, in <module>
    > NameError: name 'path' is not defined
    >>>> __name__

    > '__main__'
    >>>>

    > --


    Python does not have true globals. At most, a variable is global to
    the module. __name__ in win32file.py is going to be 'win32file'. path
    is going to be something else. Without looking at the source of the
    file, I can't tell you what it is.

    The fact that you
     
    Benjamin Kaplan, Nov 1, 2010
    #2
    1. Advertising

  3. Fossil

    Ian Guest

    On Nov 1, 3:55 pm, Fossil <> wrote:
    > Just starting with Python.
    > Installed:
    >   Python 2.7
    >   pywin32-214.win32-py2.7.exe
    >   pyserial-2.5.win32.exe
    > on a Home WinXP SP3 Toshiba laptop with 2GB memory.  Open Python and
    > try to do simple I/O test and can't even get past first line.
    > Transcript below.  You will see that
    > __name__ is defined as '__main__"
    > but path is not defined.  Could this be due to creating the folder
    > holding the Python.exe being on the E: drive or for some other obscure
    > reason?  The DOS path environmental variable includes:
    > e:\Program Files\Python27


    Unlikely. Where I work we run Python with pywin32 across the company
    from a network drive and don't have any problems like this one.

    > **********transcript*************
    >
    > Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit
    > (Intel)] on win
    > 32
    > Type "help", "copyright", "credits" or "license" for more information.>>> from uspp import *
    >
    > Traceback (most recent call last):
    >   File "<stdin>", line 1, in <module>
    >   File "E:\Python27\lib\uspp.py", line 189, in <module>
    >     from SerialPort_win import *
    >   File "E:\Python27\lib\SerialPort_win.py", line 54, in <module>
    >     from win32file import *
    >   File "E:\Python27\lib\win32file.py", line 12, in <module>
    >     __load()
    >   File "E:\Python27\lib\win32file.py", line 10, in __load
    >     mod = imp.load_dynamic(__name__, path)
    > ImportError: DLL load failed: The specified module could not be found.


    The paths in this traceback are weird. If E:\Python27 is where Python
    is installed, E:\Python27\lib should be where the files in the Python
    standard library reside. Installed third-party modules such as the
    ones above should be located in E:\Python27\lib\site-packages. It
    would appear that some zip files were incorrectly extracted into this
    folder.

    Anyway, your problem appears to be the win32file.py in E:
    \Python27\lib. This is a wrapper file that the isapi package includes
    when creating an executable with py2exe. It doesn't make any sense
    for it to be found in this location, and all it's succeeding in doing
    is obscuring the real win32file import, which should be a dll at E:
    \Python27\lib\site-packages\win32\win32file.pyd.

    I suggest reinstalling, putting things into their proper directories
    this time, and skipping whatever you unzipped that got you that
    win32file.py file.

    Hope this helps,
    Ian
     
    Ian, Nov 1, 2010
    #3
  4. Fossil

    Fossil Guest

    Thank you, Ian. You put your finger on the problem. As I thrashed
    around earlier, I had installed serial i/o pieces before the clean
    install pieces of
    pywin32-214.win32-py2.7.exe
    pyserial-2.5.win32.exe
    I did a complete de-install and re-install. Now the serial i/o is
    functioning -- I'm still stumbling along with the typical mistakes of
    a 'newbie'. Thanks again.
    Chas.
     
    Fossil, Nov 2, 2010
    #4
  5. In message
    <>, Fossil
    wrote:

    > I did a complete de-install and re-install.


    Standard solution to Dimdows problems, really...
     
    Lawrence D'Oliveiro, Nov 2, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    8,998
  2. Boki
    Replies:
    9
    Views:
    827
  3. Wenjie

    if (f() != FAIL) or if (FAIL != f())?

    Wenjie, Jul 28, 2003, in forum: C Programming
    Replies:
    3
    Views:
    479
    E. Robert Tisdale
    Jul 31, 2003
  4. Max Kotasek
    Replies:
    4
    Views:
    1,031
    Max Kotasek
    Apr 9, 2010
  5. Mr. Nonsense

    Require a module, but not fail if not found

    Mr. Nonsense, Jul 20, 2009, in forum: Perl Misc
    Replies:
    0
    Views:
    87
    Mr. Nonsense
    Jul 20, 2009
Loading...

Share This Page