sys.path with multiple Python installations

Discussion in 'Python' started by Xavier Lapointe Desjardins, Mar 5, 2009.

  1. Hi everyone :eek:),

    this is my first post on the mailing list, so I'll try to be clear
    enough. I've on my computer WinXp x64 with python 2.5 and 2.6
    installed. When I tried to run a small script using smtplib using Python
    2.6, I got that error message:

    "
    Traceback (most recent call last):
    File "< My projet path >\sandbox.py", line 2, in <module>
    import smtplib
    File "C:\Python25\Lib\smtplib.py", line 44, in <module>
    import socket
    File "C:\Python25\Lib\socket.py", line 45, in <module>
    import _socket
    ImportError: Module use of python25.dll conflicts with this version of
    Python.

    "


    So as you can see, it looks inside Python 2.5 directories, not 2.6. I
    took a look at both sys.path (2.5 and 2.6), and remarked that Python 2.5
    have its own path list, but 2.6 got its own + the 2.5 paths creating
    conflicts.
    Is there a way to avoid this? I thought removing every single path in
    python 2.6 that linked to 2.5, but maybe there's another reason/solution
    or something I should know?

    After googling a bit I saw that similar post:
    http://mail.python.org/pipermail/python-list/2008-July/498511.html, but
    the guy is on Linux.


    Thanks a lot,

    Xavier
    Xavier Lapointe Desjardins, Mar 5, 2009
    #1
    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. Don Taylor
    Replies:
    5
    Views:
    571
    Don Taylor
    Feb 22, 2006
  2. Ishwor Gurung
    Replies:
    0
    Views:
    471
    Ishwor Gurung
    Dec 17, 2009
  3. Ishwor Gurung
    Replies:
    0
    Views:
    865
    Ishwor Gurung
    Dec 17, 2009
  4. Tech Support Box
    Replies:
    1
    Views:
    472
    shrikant kesharwani
    Jan 24, 2011
  5. Eric Frederich

    multiple Python 2.7 Windows installations

    Eric Frederich, Apr 19, 2011, in forum: Python
    Replies:
    1
    Views:
    252
    Martin v. Loewis
    Apr 19, 2011
Loading...

Share This Page