Installing virtualenv virtualenvwrapper with pip on osx 10.11.1

后端 未结 1 1072
忘掉有多难
忘掉有多难 2021-01-19 04:52

Objective

Install virtualenv virtualenvwrapper

Background

I am trying to create a sample flask app by following this tutorial https://realpython.com

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-19 05:25

    You shouldn't be using your system's version of Python.

    According to Python's docs:

    The version of Python that ships with OS X is great for learning but it’s not good for development.

    According to Apple's docs:

    Developers using Perl, Python, Ruby, or any other scripting languages that ship with OS X, are encouraged to manage their own installations of the language and dependencies ...

    So, I recommend installing Python 2 and/or Python 3 using homebrew as suggested and described in Python's OS X installation docs.

    Note that these instructions provide the command to install Python 2. To install Python 3, you would run:

    brew install python3    # instead of 'brew install python'
    

    These Python installation docs also link to detailed instructions for installing virtualenv and virtualenvwrapper.

    Update:

    It looks like you have virtualenvwrapper installed, but not properly configured. When I installed it, I ran the following code based on installation docs for virtualenvwrapper to configure:

    # Create a directory to hold the virtual environments.
    mkdir $HOME/.virtualenvs
    
    echo "
    # Python's virtualenvwrapper-RELATED
    export WORKON_HOME=$HOME/.virtualenvs
    source /usr/local/bin/virtualenvwrapper.sh 
    " >> ~/.bash_profile
    source ~/.bash_profile
    

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