No module named pkg_resources

后端 未结 30 2794
一向
一向 2020-11-22 07:22

I\'m deploying a Django app to a dev server and am hitting this error when I run pip install -r requirements.txt:

Traceback (most recent call la         


        
30条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 08:08

    It also happened to me. I think the problem will happen if the requirements.txt contains a "distribute" entry while the virtualenv uses setuptools. Pip will try to patch setuptools to make room for distribute, but unfortunately it will fail half way.

    The easy solution is delete your current virtualenv then make a new virtualenv with --distribute argument.

    An example if using virtualenvwrapper:

    $ deactivate
    $ rmvirtualenv yourenv
    $ mkvirtualenv yourenv --distribute
    $ workon yourenv
    $ pip install -r requirements.txt
    

提交回复
热议问题