pip安装的django版本与requirements.txt中指定的版本不同

pip安装的django版本与requirements.txt中指定的版本不同,pip,virtualenv,requirements.txt,Pip,Virtualenv,Requirements.txt,我正在尝试做djangocms教程 在我的笔记本电脑上(在Archlinux上)一切都很好,但我尝试在另一台计算机上(使用MacOSX)继续这个项目。 我制作了我的git克隆,启动了一个新的virtualenv,并尝试进行pip安装-r requirements.txt 这是我的requirements.txt的内容(我是从pip freeze输出中获得的): 但是在pip安装之后的django版本是django 1.7.4(而不是django 1.6.11)。 我不明白为什么 以下是pip冻结

我正在尝试做djangocms教程

在我的笔记本电脑上(在Archlinux上)一切都很好,但我尝试在另一台计算机上(使用MacOSX)继续这个项目。 我制作了我的
git克隆
,启动了一个新的virtualenv,并尝试进行
pip安装-r requirements.txt

这是我的requirements.txt的内容(我是从
pip freeze
输出中获得的):

但是在
pip安装之后的django版本是django 1.7.4(而不是django 1.6.11)。
我不明白为什么

以下是
pip冻结的输出:

dj-database-url==0.3.0
Django==1.7.4
django-classy-tags==0.6.2
django-cms==3.1.2
django-reversion==1.8.5
django-sekizai==0.8.2
Django-Select2==4.3.1
django-treebeard==3.0
djangocms-admin-style==0.2.7
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.2
djangocms-inherit==0.1
djangocms-installer==0.7.8
djangocms-link==1.6.2
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.5.2
djangocms-video==0.1
html5lib==0.99999
pbr==0.10.7
Pillow==2.8.0
-e git+http://git@github.com/divio/django-polls.git@9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da#egg=polls-master
pytz==2015.4
six==1.9.0
South==1.0.2
stevedore==1.2.0
tzlocal==1.2
virtualenv==13.1.0
virtualenv-clone==0.2.5
virtualenvwrapper==4.6.0
wheel==0.24.0
以下是
pip安装-r requirements.txt的输出:

/Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting dj-database-url==0.3.0 (from -r requirements.txt (line 1))
/Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading dj_database_url-0.3.0-py2.py3-none-any.whl
Collecting Django==1.6.11 (from -r requirements.txt (line 2))
  Downloading Django-1.6.11-py2.py3-none-any.whl (6.7MB)
    100% |████████████████████████████████| 6.7MB 75kB/s
Collecting django-classy-tags==0.6.2 (from -r requirements.txt (line 3))
  Downloading django_classy_tags-0.6.2-py2-none-any.whl
Collecting django-cms==3.1.2 (from -r requirements.txt (line 4))
  Downloading django_cms-3.1.2-py2.py3-none-any.whl (3.0MB)
    100% |████████████████████████████████| 3.0MB 150kB/s
Collecting django-reversion==1.8.5 (from -r requirements.txt (line 5))
  Downloading django-reversion-1.8.5.tar.gz (57kB)
    100% |████████████████████████████████| 61kB 4.1MB/s
Collecting django-sekizai==0.8.2 (from -r requirements.txt (line 6))
  Downloading django_sekizai-0.8.2-py2.py3-none-any.whl
Collecting Django-Select2==4.3.1 (from -r requirements.txt (line 7))
  Downloading Django-Select2-4.3.1.tar.gz (97kB)
    100% |████████████████████████████████| 98kB 3.0MB/s
Collecting django-treebeard==3.0 (from -r requirements.txt (line 8))
  Downloading django-treebeard-3.0.tar.gz (93kB)
    100% |████████████████████████████████| 94kB 1.8MB/s
Collecting djangocms-admin-style==0.2.7 (from -r requirements.txt (line 9))
  Downloading djangocms_admin_style-0.2.7-py2.py3-none-any.whl (484kB)
    100% |████████████████████████████████| 487kB 834kB/s
Collecting djangocms-column==1.5 (from -r requirements.txt (line 10))
  Downloading djangocms_column-1.5-py2-none-any.whl (127kB)
    100% |████████████████████████████████| 131kB 1.7MB/s
Collecting djangocms-file==0.1 (from -r requirements.txt (line 11))
  Downloading djangocms_file-0.1-py2-none-any.whl (120kB)
    100% |████████████████████████████████| 122kB 2.8MB/s
Collecting djangocms-flash==0.2.0 (from -r requirements.txt (line 12))
  Downloading djangocms_flash-0.2.0-py2-none-any.whl (121kB)
    100% |████████████████████████████████| 122kB 3.9MB/s
Collecting djangocms-googlemap==0.2 (from -r requirements.txt (line 13))
  Downloading djangocms_googlemap-0.2-py2-none-any.whl (193kB)
    100% |████████████████████████████████| 196kB 2.4MB/s
Collecting djangocms-inherit==0.1 (from -r requirements.txt (line 14))
  Downloading djangocms_inherit-0.1-py2-none-any.whl (131kB)
    100% |████████████████████████████████| 135kB 2.5MB/s
Collecting djangocms-installer==0.7.8 (from -r requirements.txt (line 15))
  Downloading djangocms_installer-0.7.8-py2.py3-none-any.whl (47kB)
    100% |████████████████████████████████| 49kB 3.9MB/s
Collecting djangocms-link==1.6.2 (from -r requirements.txt (line 16))
  Downloading djangocms_link-1.6.2-py2-none-any.whl (151kB)
    100% |████████████████████████████████| 151kB 1.3MB/s
Collecting djangocms-picture==0.1 (from -r requirements.txt (line 17))
  Downloading djangocms_picture-0.1-py2-none-any.whl (154kB)
    100% |████████████████████████████████| 155kB 2.6MB/s
Collecting djangocms-style==1.5 (from -r requirements.txt (line 18))
  Downloading djangocms-style-1.5.tar.gz
Collecting djangocms-teaser==0.1 (from -r requirements.txt (line 19))
  Downloading djangocms_teaser-0.1-py2-none-any.whl (121kB)
    100% |████████████████████████████████| 122kB 3.0MB/s
Collecting djangocms-text-ckeditor==2.5.2 (from -r requirements.txt (line 20))
  Downloading djangocms_text_ckeditor-2.5.2-py2.py3-none-any.whl (1.6MB)
    100% |████████████████████████████████| 1.6MB 303kB/s
Collecting djangocms-video==0.1 (from -r requirements.txt (line 21))
  Downloading djangocms_video-0.1-py2-none-any.whl (176kB)
    100% |████████████████████████████████| 180kB 1.1MB/s
Collecting html5lib==0.99999 (from -r requirements.txt (line 22))
  Downloading html5lib-0.99999.tar.gz (887kB)
    100% |████████████████████████████████| 888kB 493kB/s
Collecting Pillow==2.8.0 (from -r requirements.txt (line 23))
  Downloading Pillow-2.8.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.8MB)
    100% |████████████████████████████████| 2.8MB 162kB/s
Obtaining polls-master from git+http://git@github.com/divio/django-polls.git@9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da#egg=polls-master (from -r requirements.txt (line 24))
  Cloning http://git@github.com/divio/django-polls.git (to 9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da) to /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/src/polls-master
  Could not find a tag or branch '9fb91e49e2e56cf59ab0cfcddb17c35afbdd06da', assuming commit.
Collecting pytz==2015.4 (from -r requirements.txt (line 25))
  Downloading pytz-2015.4-py2.py3-none-any.whl (475kB)
    100% |████████████████████████████████| 475kB 1.1MB/s
Requirement already satisfied (use --upgrade to upgrade): six==1.9.0 in /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages (from -r requirements.txt (line 26))
Collecting South==1.0.2 (from -r requirements.txt (line 27))
  Downloading South-1.0.2.tar.gz (96kB)
    100% |████████████████████████████████| 98kB 3.3MB/s
Collecting tzlocal==1.2 (from -r requirements.txt (line 28))
  Downloading tzlocal-1.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): wheel==0.24.0 in /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/lib/python2.7/site-packages (from -r requirements.txt (line 29))
Requirement already satisfied (use --upgrade to upgrade): argparse in /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages (from djangocms-installer==0.7.8->-r requirements.txt (line 15))
Requirement already satisfied (use --upgrade to upgrade): pip in /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms/lib/python2.7/site-packages (from djangocms-installer==0.7.8->-r requirements.txt (line 15))
Building wheels for collected packages: django-reversion, Django-Select2, django-treebeard, djangocms-style, html5lib, South, tzlocal
  Running setup.py bdist_wheel for django-reversion
  Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/51/b4/ea/033db3e78df246021ef65c216c3f716efd5882021289378705
  Running setup.py bdist_wheel for Django-Select2
  Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/a7/e2/92/a069a90e2595d4a5dbc9f0609d52d8bea9555e42153828eebb
  Running setup.py bdist_wheel for django-treebeard
  Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/73/8e/8b/3d72e01575557ffeeb1ef648581006d468a415ed868abbfb5d
  Running setup.py bdist_wheel for djangocms-style
  Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/5b/80/87/41ea156cdab7a7a170122f3a3b77af473ae855612d4d88d6a2
  Running setup.py bdist_wheel for html5lib
  Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/44/5c/08/f97a40f63f914c4c3a9798e1ff5606b5ab19fe5dcfb64e27b6
  Running setup.py bdist_wheel for South
  Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/11/2b/ca/a57966e1943759859dd94f3ebc5c279450bee11e07d600e3a3
  Running setup.py bdist_wheel for tzlocal
  Stored in directory: /nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Caches/pip/wheels/39/8d/3b/21db6b23bc7483a2e1cf391865427e8fbd090223d9db2cfab3
Successfully built django-reversion Django-Select2 django-treebeard djangocms-style html5lib South tzlocal
Installing collected packages: dj-database-url, Django, django-classy-tags, django-sekizai, django-treebeard, djangocms-admin-style, html5lib, django-cms, django-reversion, Django-Select2, djangocms-column, djangocms-file, djangocms-flash, djangocms-googlemap, djangocms-inherit, pytz, tzlocal, djangocms-installer, djangocms-link, djangocms-picture, djangocms-style, djangocms-teaser, Pillow, djangocms-text-ckeditor, djangocms-video, polls-master, South
  Found existing installation: Django 1.7.4
    Not uninstalling Django at /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages, outside environment /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms
  Running setup.py develop for polls-master
Successfully installed Django-1.7.4 Django-Select2-4.3.1 Pillow-2.8.0 South-1.0.2 dj-database-url-0.3.0 django-classy-tags-0.6.2 django-cms-3.1.2 django-reversion-1.8.5 django-sekizai-0.8.2 django-treebeard-3.0 djangocms-admin-style-0.2.7 djangocms-column-1.5 djangocms-file-0.1 djangocms-flash-0.2.0 djangocms-googlemap-0.2 djangocms-inherit-0.1 djangocms-installer-0.7.8 djangocms-link-1.6.2 djangocms-picture-0.1 djangocms-style-1.5 djangocms-teaser-0.1 djangocms-text-ckeditor-2.5.2 djangocms-video-0.1 html5lib-0.99999 polls-master pytz-2015.4 tzlocal-1.2
Django 1.7.4似乎安装在末尾

为什么?

我怎样才能避免这种情况?我当前的项目无法使用此版本,本教程要求使用Django 1.6

编辑:

我刚刚发现在我的virtualenv的站点包中,django的版本是1.6.11。所以我的virtualenv可能使用了错误的站点包

为什么?

我怎样才能解决这个问题


通常,当我们使用virtualenv时,它不应该使用正确的站点包目录吗?

pip安装-r requirements.txt的最后5行提供了答案:

Successfully built django-reversion Django-Select2 django-treebeard djangocms-style html5lib South tzlocal
Installing collected packages: dj-database-url, Django, django-classy-tags, django-sekizai, django-treebeard, djangocms-admin-style, html5lib, django-cms, django-reversion, Django-Select2, djangocms-column, djangocms-file, djangocms-flash, djangocms-googlemap, djangocms-inherit, pytz, tzlocal, djangocms-installer, djangocms-link, djangocms-picture, djangocms-style, djangocms-teaser, Pillow, djangocms-text-ckeditor, djangocms-video, polls-master, South
  Found existing installation: Django 1.7.4
    Not uninstalling Django at /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages, outside environment /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms
  Running setup.py develop for polls-master
Successfully installed Django-1.7.4 Django-Select2-4.3.1 Pillow-2.8.0 South-1.0.2 dj-database-url-0.3.0 django-classy-tags-0.6.2 django-cms-3.1.2 django-reversion-1.8.5 django-sekizai-0.8.2 django-treebeard-3.0 djangocms-admin-style-0.2.7 djangocms-column-1.5 djangocms-file-0.1 djangocms-flash-0.2.0 djangocms-googlemap-0.2 djangocms-inherit-0.1 djangocms-installer-0.7.8 djangocms-link-1.6.2 djangocms-picture-0.1 djangocms-style-1.5 djangocms-teaser-0.1 djangocms-text-ckeditor-2.5.2 djangocms-video-0.1 html5lib-0.99999 polls-master pytz-2015.4 tzlocal-1.2
您已经安装了
Django 1.7.4

找到现有安装:Django 1.7.4。我相信这就是为什么没有安装Django 1.6.11的原因。因此,输出消息是:没有在/Volumes/Data/…卸载Django

IRC上有人向我解释了问题:

它与我的系统路径和我的$PYTHONPATH有关: 我在我的$PYTHONPATH中添加了主python路径(标准路径,不使用virtualenv),因此我的$PYTHONPATH作为前缀添加到我的sys.path中,并且在导入virtualenv外部的django之前导入了内部的django


我只需在我的~/.zshrc中取消设置$PYTHONPATH,它就像一个符咒

我不明白这一部分:/但我刚刚发现我的virtualenv可能使用了错误的网站包目录,但我仍然不明白为什么,我编辑了我的帖子。
Successfully built django-reversion Django-Select2 django-treebeard djangocms-style html5lib South tzlocal
Installing collected packages: dj-database-url, Django, django-classy-tags, django-sekizai, django-treebeard, djangocms-admin-style, html5lib, django-cms, django-reversion, Django-Select2, djangocms-column, djangocms-file, djangocms-flash, djangocms-googlemap, djangocms-inherit, pytz, tzlocal, djangocms-installer, djangocms-link, djangocms-picture, djangocms-style, djangocms-teaser, Pillow, djangocms-text-ckeditor, djangocms-video, polls-master, South
  Found existing installation: Django 1.7.4
    Not uninstalling Django at /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages, outside environment /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Envs/djangocms
  Running setup.py develop for polls-master
Successfully installed Django-1.7.4 Django-Select2-4.3.1 Pillow-2.8.0 South-1.0.2 dj-database-url-0.3.0 django-classy-tags-0.6.2 django-cms-3.1.2 django-reversion-1.8.5 django-sekizai-0.8.2 django-treebeard-3.0 djangocms-admin-style-0.2.7 djangocms-column-1.5 djangocms-file-0.1 djangocms-flash-0.2.0 djangocms-googlemap-0.2 djangocms-inherit-0.1 djangocms-installer-0.7.8 djangocms-link-1.6.2 djangocms-picture-0.1 djangocms-style-1.5 djangocms-teaser-0.1 djangocms-text-ckeditor-2.5.2 djangocms-video-0.1 html5lib-0.99999 polls-master pytz-2015.4 tzlocal-1.2