Installing pySerial

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe G \(Home\)

    Installing pySerial

    Hi All,

    Background
    =============== ====
    I have installed Python for windows today from the python web site .I also
    installed pySerial using the Windows installer from the sourceforge web
    site..... Both installs use the default directories.

    Phyton version : Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC
    v.1310 32 bit (Intel)] on win32

    pySerial 2.4 July 6th


    Problem : Errors Screen output
    =============== =============
    >>import serial
    Traceback (most recent call last):
    File "<pyshell#0 >", line 1, in <module>
    import serial
    File "C:\Python25\Li b\site-packages\serial \__init__.py", line 18, in
    <module>
    from serialwin32 import *
    File "C:\Python25\Li b\site-packages\serial \serialwin32.py ", line 9, in
    <module>
    import win32file # The base COM port and file IO functions.
    ImportError: No module named win32file
    >>>
    So it looks like Python can not see some of the modules

    Here's the active paths
    >>print sys.path
    ['C:\\Python25\\ Lib\\idlelib', 'C:\\WINDOWS\\s ystem32\\python 25.zip',
    'C:\\Python25\\ DLLs', 'C:\\Python25\\ lib', 'C:\\Python25\\ lib\\plat-win',
    'C:\\Python25\\ lib\\lib-tk', 'C:\\Python25',
    'C:\\Python25\\ lib\\site-packages']
    >>>
    It seems that C:\Python25\Lib \site-packages\serial needs to be added to
    the PYTHONPATH


    QUESTION
    =============
    Q1. How do I add C:\Python25\Lib \site-packages\serial to the PYTHONPATH ?

    Q2. How do I check that I have installed pySerial corretly (using the
    Windows installer)

    Thanks in advance


    Joe









  • Tim Golden

    #2
    Re: Installing pySerial

    Joe G (Home) wrote:
    Hi All,
    >
    Background
    =============== ====
    I have installed Python for windows today from the python web site .I also
    installed pySerial using the Windows installer from the sourceforge web
    site..... Both installs use the default directories.
    >
    Phyton version : Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC
    v.1310 32 bit (Intel)] on win32
    >
    pySerial 2.4 July 6th
    >
    >
    Problem : Errors Screen output
    =============== =============
    >>>import serial
    >
    Traceback (most recent call last):
    File "<pyshell#0 >", line 1, in <module>
    import serial
    File "C:\Python25\Li b\site-packages\serial \__init__.py", line 18, in
    <module>
    from serialwin32 import *
    File "C:\Python25\Li b\site-packages\serial \serialwin32.py ", line 9, in
    <module>
    import win32file # The base COM port and file IO functions.
    ImportError: No module named win32file
    You need to install the pywin32 extensions from:



    They're so commonly used (and, if you install the ActiveState
    distro of Python, even bundled) that I imagine many Windows
    Pythoneers like myself simply install them automatically as
    soon as we've installed the main python.org Python.

    Once you've done that, the rest should just work: it's
    clear from the traceback that the serial module is getting
    imported; it's just trying to find the win32file module.

    TJG

    Comment

    • Richard Brodie

      #3
      Re: Installing pySerial


      "Joe G (Home)" <joe.g@optusnet .com.auwrote in message
      news:48d2781f$0 $4449$afc38c87@ news.optusnet.c om.au...
      I have installed Python for windows today from the python web site .I also installed
      pySerial using the Windows installer from the sourceforge web site.....
      You need to read the pySerial smallprint, where it says:

      "The files in this package are 100% pure Python. They depend on non standard but
      common packages on Windows (pywin32) and Jython (JavaComm).
      POSIX (Linux, BSD) uses only modules from the standard Python distribution)"



      Comment

      • Grant Edwards

        #4
        Re: Installing pySerial

        On 2008-09-18, Joe G (Home) <joe.g@optusnet .com.auwrote:
        Hi All,
        >
        Background
        >============== =====
        I have installed Python for windows today from the python web site .I also
        installed pySerial using the Windows installer from the sourceforge web
        site..... Both installs use the default directories.
        >
        Phyton version : Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC
        v.1310 32 bit (Intel)] on win32
        >
        pySerial 2.4 July 6th
        >
        >
        Problem : Errors Screen output
        >============== ==============
        >>>import serial
        >
        Traceback (most recent call last):
        File "<pyshell#0 >", line 1, in <module>
        import serial
        File "C:\Python25\Li b\site-packages\serial \__init__.py", line 18, in
        ><module>
        from serialwin32 import *
        File "C:\Python25\Li b\site-packages\serial \serialwin32.py ", line 9, in
        ><module>
        import win32file # The base COM port and file IO functions.
        ImportError: No module named win32file
        >>>>
        >
        So it looks like Python can not see some of the modules
        Do you have the win32 modules installed?
        Here's the active paths
        >
        >>>print sys.path
        ['C:\\Python25\\ Lib\\idlelib', 'C:\\WINDOWS\\s ystem32\\python 25.zip',
        'C:\\Python25\\ DLLs', 'C:\\Python25\\ lib', 'C:\\Python25\\ lib\\plat-win',
        'C:\\Python25\\ lib\\lib-tk', 'C:\\Python25',
        'C:\\Python25\\ lib\\site-packages']
        >>>>
        >
        It seems that C:\Python25\Lib \site-packages\serial needs to be added to
        the PYTHONPATH
        I don't see how you came to that conclusion. Is the "missing"
        module (win32file) located in C:\Python25\Lib \site-packages\serial ?
        QUESTION
        >============ =
        Q1. How do I add C:\Python25\Lib \site-packages\serial to the PYTHONPATH ?
        Dunno.
        Q2. How do I check that I have installed pySerial corretly
        (using the Windows installer)
        If you used the installer, you almost undoubtedly have it
        installed correctly. I think you're missing the win32 package.



        --
        Grant Edwards grante Yow! I'm not an Iranian!!
        at I voted for Dianne
        visi.com Feinstein!!

        Comment

        • Joe G \(Home\)

          #5
          Re: Installing pySerial

          Yep up and running now.

          Many thanks

          Joe


          Comment

          • eliben

            #6
            Re: Installing pySerial

            On Sep 18, 6:01 pm, Tim Golden <m...@timgolden .me.ukwrote:
            Joe G (Home) wrote:
            Hi All,
            >
            Background
            =============== ====
            I have installed Python for windows today from the python web site  .I also
            installed pySerial using the Windows installer from the sourceforge web
            site..... Both installs use the default directories.
            >
            Phyton  version    : Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC
            v.1310 32 bit (Intel)] on win32
            >
            pySerial   2.4   July 6th
            >
            Problem :  Errors Screen output
            =============== =============
            >>import serial
            >
            Traceback (most recent call last):
              File "<pyshell#0 >", line 1, in <module>
                import serial
              File "C:\Python25\Li b\site-packages\serial \__init__.py", line 18, in
            <module>
                from serialwin32 import *
              File "C:\Python25\Li b\site-packages\serial \serialwin32.py ", line 9,in
            <module>
                import win32file  # The base COM port and file IO functions.
            ImportError: No module named win32file
            >
            You need to install the pywin32 extensions from:
            >
             http://pywin32.sf.net
            >
            They're so commonly used (and, if you install the ActiveState
            distro of Python, even bundled) that I imagine many Windows
            Pythoneers like myself simply install them automatically as
            soon as we've installed the main python.org Python.
            >
            Once you've done that, the rest should just work: it's
            clear from the traceback that the serial module is getting
            imported; it's just trying to find the win32file module.
            >
            Why are people preferring the python.org package over ActiveState's,
            which seems to be more complete and includes more modules (like
            pywin32) ?

            Eli

            Comment

            • Gabriel Genellina

              #7
              Re: Installing pySerial

              En Sat, 20 Sep 2008 02:01:14 -0300, eliben <eliben@gmail.c omescribió:
              Why are people preferring the python.org package over ActiveState's,
              which seems to be more complete and includes more modules (like
              pywin32) ?
              They do a hard work collecting, compiling and packaging the Python
              distribution with some added modules. But anything you get in the AS free
              version you can get directly from the original authors; downloading
              pywin32 from sourceforge isn't so difficult...
              And AFAIR, it took about 2 months the guys at ActiveState to release the
              2.5 version after it came from python.org

              --
              Gabriel Genellina

              Comment

              Working...