Setting up a virtualenv: No module named 'pip'

后端 未结 3 945
陌清茗
陌清茗 2020-12-05 19:15

I have a fresh install of Python 3.3.4 on a Windows Server 2008 R2 machine. I\'ve successfully installed the latest versions of Setuptools, Pip and Virtualenv globally:

相关标签:
3条回答
  • 2020-12-05 19:31

    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

    0 讨论(0)
  • 2020-12-05 19:41

    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

    0 讨论(0)
  • 2020-12-05 19:47

    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.

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