Modules between multiple versions of Python Linux

前端 未结 2 804
情书的邮戳
情书的邮戳 2020-12-21 02:58

I have Python2.6.5 and Python2.4.4 on my linux machine.

At the moment, all the modules I have (wx, ply, pyserial, twisted, to name a few) are installed for the 2.6 v

相关标签:
2条回答
  • 2020-12-21 03:05

    Don't attempt to share them; this has some chance of success with pure Python modules, but C modules will fail to work. Instead, install them using the appropriate interpreter executable, e.g. python2.4 setup.py install.

    0 讨论(0)
  • 2020-12-21 03:25

    You can't share modules between different versions of Python. If you want to use wxPython from Python 2.4, you need to install it for Python 2.4.

    You said you tried to install it with Python 2.4 as your "primary". I'm not sure what that means. You would install wxPython for Python 2.4 by running the installer with Python 2.4, like so:

    $sudo /usr/bin/python2.4 setup.py install
    

    Or similar.

    You can use easy_install as well, but then you need to install Distribute for Python 2.4 first. Did you do that?

    I recently wrote a full explanation on my blog about this: http://regebro.wordpress.com/2011/02/02/newbie-hint-on-installing-python-and-its-modules-and-packages/

    0 讨论(0)
提交回复
热议问题