Setting up a virtualenv: No module named 'pip'

泄露秘密 提交于 2019-11-28 09:09:30

Useful workaround from the Python bug ticket for anybody else with this issue:

  • Run virtualenv venv --no-setuptools
  • Activate that virtualenv (venv\Scripts\activate)
  • Download and run get-pip.py to manually install pip & setuptools into this virtualenv
  • Continue as normal

Alternatively, downgrade to 3.3.3. This should be fixed properly in 3.3.5

Annoyingly, it looks like this might be a Python bug. https://github.com/pypa/virtualenv/issues/564 references http://bugs.python.org/issue20621, which is still open but looks like it's going to be fixed in 3.3.5.

Dropping my Python installation back down to 3.3.3 fixed the issue.

I know it says Update in bold at the bottom of your question, but my colleague and I both missed that you answered your own question.

So, in case anyone else might miss it, try the --system-site-packages flag. This worked for us:

virtualenv ENV --system-site-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!