无法使用Pipenv安装频道(django)

时间:2018-10-09 15:17:39

标签: python django django-channels pipenv

当我尝试使用pipenv安装django channels时,它失败了,据说是因为它无法在https://pypi.python.org/simple中找到“ zope-in​​terface”版本4.5.0。

$ pipenv install channels
Installing channels…
Looking in indexes: https://pypi.python.org/simple
Collecting channels
  Using cached https://files.pythonhosted.org/packages/e3/ea/65e947afe102b1b5798f6890479426e8f481df0ec7a4cbba21bdd2897ef9/channels-2.1.3-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: Django>=1.11 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from channels) (2.1.2)
Requirement already satisfied, skipping upgrade: asgiref~=2.3 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from channels) (2.3.2)
Requirement already satisfied, skipping upgrade: daphne~=2.2 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from channels) (2.2.2)
Requirement already satisfied, skipping upgrade: pytz in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from Django>=1.11->channels) (2018.5)
Requirement already satisfied, skipping upgrade: async-timeout<4.0,>=2.0 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from asgiref~=2.3->channels) (3.0.1)
Requirement already satisfied, skipping upgrade: autobahn>=0.18 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from daphne~=2.2->channels) (18.9.2)
Requirement already satisfied, skipping upgrade: twisted>=18.7 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from daphne~=2.2->channels) (18.7.0)
Requirement already satisfied, skipping upgrade: txaio>=18.8.1 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from autobahn>=0.18->daphne~=2.2->channels) (18.8.1)
Requirement already satisfied, skipping upgrade: six>=1.11.0 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from autobahn>=0.18->daphne~=2.2->channels) (1.11.0)
Requirement already satisfied, skipping upgrade: PyHamcrest>=1.9.0 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from twisted>=18.7->daphne~=2.2->channels) (1.9.0)
Requirement already satisfied, skipping upgrade: zope.interface>=4.4.2 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from twisted>=18.7->daphne~=2.2->channels) (4.5.0)
Requirement already satisfied, skipping upgrade: hyperlink>=17.1.1 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from twisted>=18.7->daphne~=2.2->channels) (18.0.0)
Requirement already satisfied, skipping upgrade: attrs>=17.4.0 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from twisted>=18.7->daphne~=2.2->channels) (18.2.0)
Requirement already satisfied, skipping upgrade: incremental>=16.10.1 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from twisted>=18.7->daphne~=2.2->channels) (17.5.0)
Requirement already satisfied, skipping upgrade: Automat>=0.3.0 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from twisted>=18.7->daphne~=2.2->channels) (0.7.0)
Requirement already satisfied, skipping upgrade: constantly>=15.1 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from twisted>=18.7->daphne~=2.2->channels) (15.1.0)
Requirement already satisfied, skipping upgrade: setuptools in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from PyHamcrest>=1.9.0->twisted>=18.7->daphne~=2.2->channels) (40.4.3)
Requirement already satisfied, skipping upgrade: idna>=2.5 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from hyperlink>=17.1.1->twisted>=18.7->daphne~=2.2->channels) (2.7)
Installing collected packages: channels
Successfully installed channels-2.1.3

Adding channels to Pipfile's [packages]…
Pipfile.lock (bd0b0a) out of date, updating to (7cafae)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (bd0b0a)!
Installing dependencies from Pipfile.lock (bd0b0a)…
     ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 27/27 — 00:00:02
An error occurred while installing zope-interface==4.5.0 --hash=sha256:21506674d30c009271fe68a242d330c83b1b9d76d62d03d87e1e9528c61beea6 --hash=sha256:3d184aff0756c44fff7de69eb4cd5b5311b6f452d4de28cb08343b3f21993763 --hash=sha256:467d364b24cb398f76ad5e90398d71b9325eb4232be9e8a50d6a3b3c7a1c8789 --hash=sha256:57c38470d9f57e37afb460c399eb254e7193ac7fb8042bd09bdc001981a9c74c --hash=sha256:9ada83f4384bbb12dedc152bcdd46a3ac9f5f7720d43ac3ce3e8e8b91d733c10 --hash=sha256:a1daf9c5120f3cc6f2b5fef8e1d2a3fb7bbbb20ed4bfdc25bc8364bc62dcf54b --hash=sha256:e6b77ae84f2b8502d99a7855fa33334a1eb6159de45626905cb3e454c023f339 --hash=sha256:e881ef610ff48aece2f4ee2af03d2db1a146dc7c705561bd6089b2356f61641f --hash=sha256:f41037260deaacb875db250021fe883bf536bf6414a4fd25b25059b02e31b120! Will try again.
Installing initially failed dependencies…
Looking in indexes: https://pypi.python.org/simple00
Collecting zope-interface==4.5.0 

  Could not find a version that satisfies the requirement zope-interface==4.5.0 (from -r /tmp/pipenv-yh0ggj8v-requirements/pipenv-t7csyjxt-requirement.txt (line 1)) (from versions: 4.4.0, 4.4.1, 4.4.2, 4.4.3)
No matching distribution found for zope-interface==4.5.0 (from -r /tmp/pipenv-yh0ggj8v-requirements/pipenv-t7csyjxt-requirement.txt (line 1))

  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 00:00:00

显然,这不是我第一次尝试时的输出,因为大多数要求已经满足。在已经满足的要求列表中,第11位尤其值得注意:

Requirement already satisfied, skipping upgrade: zope.interface>=4.4.2 in /home/dan/.local/share/virtualenvs/gmtools-QMaEj5K6/lib/python3.6/site-packages (from twisted>=18.7->daphne~=2.2->channels) (4.5.0)

因此,如果已经安装了zope.interface 4.5.0,为什么找不到它?是因为zope-interfacezope.interface是不同的东西吗?如果错误消息的实际含义不是以(from versions: 4.4.0, 4.4.1, 4.4.2, 4.4.3)结尾,我会感到困惑-这些是zope.interface的4.5.0之前的版本,因此zope-interface是似乎是别名。如果转到安装说明正在使用的索引https://pypi.python.org/simple,则可以找到zope.interface却找不到zope-interfacezope.interface的版本为4.5.0。因此,如果查找的名称不存在,它将如何查找以前的版本?如果是某种别名,为什么找不到4.5.0?

我假设这是我的配置问题,但是我不知道它与通道还是pipenv有关。很高兴提供其他信息,但我不知道会有什么帮助。

1 个答案:

答案 0 :(得分:2)

这个问题似乎已经解决了。我执行了以下步骤:

  1. $ pipenv run pip install channels
  2. 手动在您的Pip文件channels="*"
  3. 中添加一行
  4. $ pipenv lock

但是我不认为这实际上是解决问题的方法-现在,只要我跑步...

$ pipenv uninstall channels
$ pipenv install channels

...它也可以正常工作,以前从未发生过。也许旧的https://pypi.python.org/simple缓存版本存在某种问题?

使用pipenv版本2018.10.9,pip版本18.1和python 3.6.6。