错误:pkg_resources.DistributionNotFound:找不到'django == 1.9.1'发行版 [英] Error: pkg_resources.DistributionNotFound: The 'django==1.9.1' distribution was not found

查看:108
本文介绍了错误:pkg_resources.DistributionNotFound:找不到'django == 1.9.1'发行版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在python环境中运行服务器时,出现以下错误跟踪:

I am getting following error trace when I am trying to run server in python environment:

Traceback (most recent call last):
  File "/home/web/.virtualenvs/kolibri/bin/kolibri", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/home/web/.virtualenvs/kolibri/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/home/web/.virtualenvs/kolibri/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/home/web/.virtualenvs/kolibri/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/web/.virtualenvs/kolibri/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 637, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/web/.virtualenvs/kolibri/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/web/.virtualenvs/kolibri/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'django==1.9.1' distribution was not found and is required by kolibri  

必需的,它与django == 1.9有关.1。知道为什么会这样吗?

Its related to django==1.9.1. Any idea why this is happening???

推荐答案

是的,发现ans,只需运行命令:

Yeah found an ans , just run the command:

sudo pip install -U djangorestframework

或者您可以按照以下步骤操作:

or you can follow the steps:

* first check version of django
* if it is not given as per distrubution package then delete it using following command:
    $ pip uninstall Django
* again install specific version of django:
    $ pip install django==1.9.1  (e.g 1.9.6 or 1.8 or 1.7)
    $ django-admin --version  // 1.9.1

这篇关于错误:pkg_resources.DistributionNotFound:找不到'django == 1.9.1'发行版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆