python 3.2 import issue

后端 未结 3 2060
-上瘾入骨i
-上瘾入骨i 2020-12-22 00:21

I\'ve been troubleshooting for the past few days trying to install distribute so I can start importing 3rd party modules. I haven\'t used python for a couple years so I\'m r

3条回答
  •  春和景丽
    2020-12-22 00:41

    To install distribute (and pip, virtualenv):

    #!/bin/bash
    # download latest virtualenv.py
    wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py
    
    # create a bootstrap virtual environment in ./venv directory
    python3 virtualenv.py venv
    

    To activate virtualenv:

    $ . ./venv/bin/activate
    

    Now you could use pip, easy_install to install other packages or use virtualenv-3.x to create new virtualenvs.

    If you use many virtualenvs (different projects, different python versions); you could pip installvirtualenvwrapper to manage them easily e.g., workon/mkvirtualenv/rmvirtualenv commands.

提交回复
热议问题