Broken references in Virtualenvs

前端 未结 26 1296
一整个雨季
一整个雨季 2020-11-27 08:53

I recently installed a bunch of dotfiles on my Mac along with some other applications (I changed to iTerm instead of Terminal, and Sublime as my default text editor) but eve

26条回答
  •  星月不相逢
    2020-11-27 09:17

    This occurred when I updated to Mac OS X Mavericks from Snow Leopard. I had to re-install brew beforehand too. Hopefully you ran the freeze command for your project with pip.

    To resolve, you have to update the paths that the virtual environment points to.

    • Install a version of python with brew:

    brew install python

    • Re-install virtualenvwrapper.

    pip install --upgrade virtualenvwrapper

    • Removed the old virtual environment:

    rmvirtualenv old_project

    • Create a new virtual environment:

    mkvirtualenv new_project

    • Work on new virtual environment

    workon new_project

    • Use pip to install the requirements for the new project.

    pip install -r requirements.txt

    This should leave the project as it was before.

提交回复
热议问题