search

Home  >  Q&A  >  body text

python3.x - python多版本共存时,默认easy_install,yum install都安装python2的库了,怎么解决这个问题?

希望能安装python3的库,但是python2 link 到了/usr/bin/python,python3 link 到了/usr/bin/python3

阿神阿神2767 days ago503

reply all(7)I'll reply

  • 高洛峰

    高洛峰2017-04-17 16:56:46

    http://www.nowamagic.net/academy/detail/1330228
    python virtualenv

    reply
    0
  • 阿神

    阿神2017-04-17 16:56:46

    Please use pip3

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 16:56:46

    If you need to coexist with multiple versions of Python, it is recommended to use pyenv https://github.com/yyuu/pyenv

    Or run your command with absolute path

    ~/.pyenv/versions/2.6.9/bin/pip install tornado

    This code installs tornado into the python directory of version 2.6.9

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 16:56:46

    Use absolute paths

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 16:56:46

    For multi-version coexistence, you can use virtualenv to create a virtual running environment and install the python3 library in the virtual environment.

    reply
    0
  • 阿神

    阿神2017-04-17 16:56:46

    All python scripts are run through virtualenv. Develop the habit of one project and one environment

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 16:56:46

    If you are in a Linux environment, you can use pyenv to switch versions. You can refer to this article to try:
    Python multi-version coexistence tool-Configuration of Pyenv and Anaconda scientific computing environment

    reply
    0
  • Cancelreply