problem with interpreter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chusky

    problem with interpreter

    Hi !

    I have Python installed on C:\Python25
    Yesterday I added new "wx" library to the Python

    when I run C:\Python25\pyt hon.exe from the command line there is a
    problem with finding libraries:

    C:\Python25>pyt hon.exe
    Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
    (Intel)] on
    win32
    Type "help", "copyright" , "credits" or "license" for more information.
    >>import wx
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "C:\Python25\Li b\site-packages\wx-2.8-msw-ansi\wx\__init_ _.py",
    line 45,
    in <module>
    from wx._core import *
    File "C:\Python25\Li b\site-packages\wx-2.8-msw-ansi\wx\_core.p y",
    line 5, in <
    module>
    import new
    File "new.py", line 1
    import
    ^
    SyntaxError: invalid syntax
    >>>

    /////////////////////

    ..... that problem doesn't exist when I run python.exe from different
    location (C:\, D:\) with python in the system path
  • Diez B. Roggisch

    #2
    Re: problem with interpreter

    chusky wrote:
    Hi !
    >
    I have Python installed on C:\Python25
    Yesterday I added new "wx" library to the Python
    >
    when I run C:\Python25\pyt hon.exe from the command line there is a
    problem with finding libraries:
    >
    C:\Python25>pyt hon.exe
    Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
    (Intel)] on
    win32
    Type "help", "copyright" , "credits" or "license" for more information.
    >>>import wx
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "C:\Python25\Li b\site-packages\wx-2.8-msw-ansi\wx\__init_ _.py",
    line 45,
    in <module>
    from wx._core import *
    File "C:\Python25\Li b\site-packages\wx-2.8-msw-ansi\wx\_core.p y",
    line 5, in <
    module>
    import new
    File "new.py", line 1
    import
    ^
    SyntaxError: invalid syntax
    >>>>
    >
    >
    /////////////////////
    >
    .... that problem doesn't exist when I run python.exe from different
    location (C:\, D:\) with python in the system path
    Do you by any chance have a file "new.py", or new.pyc lying around? It's
    always a bad idea to name your own modules after standard-modules (new is a
    standard-module), as they might get picked up first.

    Diez

    Comment

    • Fredrik Lundh

      #3
      Re: problem with interpreter

      chusky wrote:
      File "C:\Python25\Li b\site-packages\wx-2.8-msw-ansi\wx\_core.p y",
      line 5, in <
      module>
      import new
      File "new.py", line 1
      import
      ^
      SyntaxError: invalid syntax
      wxPython tries to import the module "new" from Python's standard
      library, but picks up a broken module named "new.py" from your
      development directory instead.

      </F>

      Comment

      Working...