Getting a python virtual env error after installing Lion

后端 未结 9 540
情话喂你
情话喂你 2020-12-04 19:44

I haven\'t touched python and virtualenv in a while, and I believe I setup my MBP with virtualenv and pip, but have totally forgotten how this stuff works.

After ins

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 20:22

    Have you installed virtualenv for the Python that you are using? If you are using the default Apple-supplied system Python 2.7, it doesn't come with the virtualenv package pre-installed. Use /usr/bin/easy_install to install it.

    UPDATE: Just to be clear, on Lion 10.7, there is now an Apple-supplied Python 2.7 which is the default version when you use /usr/bin/python. Apple continues to also ship a Python 2.6 and a 2.5 in Lion as it did in 10.6 Snow Leopard. You can pick which version you want by explicitly referencing it, as in /usr/bin/python2.7, /usr/bin/python2.6, etc, and you can change the default that /usr/bin/python uses; read the Apple man page (man python) for details. The key point, though, is that, in general, Python packages are installed to a specific version. If you installed something for 2.6, you'll need to install it with python2.7 (or easy_install-2.7) if you want to use it with 2.7.

提交回复
热议问题