Django 在安装 django-fcm 时得到更新。如何在不更新django的情况下安装django-fcm

Django gets updated while installing django-fcm . How to install django-fcm without updating django

我的django版本是1.8.3。我读到它支持 django-fcm。 我尝试使用

在我的 virtual environment 中安装 django-fcm
pip install django-fcm

遗憾的是 运行 此命令将我现有的 django 版本替换为 1.10 并将 djangorestframework 从 3.2.2 替换为 3.5.2

这是日志

pip install django-fcm
Requirement already satisfied: django-fcm in /home/sudheer/virtualenvs/mediaone/lib/python2.7/site-packages
Collecting djangorestframework>=3.3.2 (from django-fcm)
  Using cached djangorestframework-3.5.3-py2.py3-none-any.whl
Collecting django>=1.9 (from django-fcm)
  Using cached Django-1.10.4-py2.py3-none-any.whl
Collecting pytz>=2015.7 (from django-fcm)
  Using cached pytz-2016.10-py2.py3-none-any.whl
Collecting requests>=2.9.1 (from django-fcm)
  Using cached requests-2.12.4-py2.py3-none-any.whl
Installing collected packages: djangorestframework, django, pytz, requests
  Found existing installation: djangorestframework 3.2.2
    Uninstalling djangorestframework-3.2.2:
      Successfully uninstalled djangorestframework-3.2.2
  Found existing installation: Django 1.8.3
    Uninstalling Django-1.8.3:
      Successfully uninstalled Django-1.8.3
  Found existing installation: pytz 2015.4
    Uninstalling pytz-2015.4:
      Successfully uninstalled pytz-2015.4
  Found existing installation: requests 2.7.0
    Uninstalling requests-2.7.0:
      Successfully uninstalled requests-2.7.0
Successfully installed django-1.10.4 djangorestframework-3.5.3 pytz-2016.10 requests-2.12.4

有什么办法可以防止这种情况发生。 我只想安装 django-fcm

您可以通过 pip install -h

使用此可用选项

pip 有一个 --no-deps 选项。

--no-deps 不安装依赖包

或者,将应用程序的依赖项放在需求文件中,您可以在其中列出所需的特定版本。当你想更新一个包时,pip 会知道你指定的其他包,而不是升级包。

requirements.txt

django==1.8.3
djangorestframework==3.2.2
django-fcm==<some version>

然后安装

pip install -r requirements.txt