pip安装:如何强制一个特定的包版本 [英] pip install: How to force a specific package version

查看:2669
本文介绍了pip安装:如何强制一个特定的包版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装Django 1.4.3,但是当我执行点安装时,pip继续安装Django 1.5版本而不是1.4.3

I'm trying to install Django 1.4.3, but when I execute pip install, pip keeps installing Django 1.5 version instead 1.4.3

sudo pip install -I Django == 1.4.3

它返回:

Downloading/unpacking Django==1.4.3
  Running setup.py egg_info for package Django

    warning: no previously-included files matching '__pycache__' found under directory '*'
    warning: no previously-included files matching '*.py[co]' found under directory '*'
=== >>>> Requested Django==1.4.3, but installing version 1.5 <<<< ====
Installing collected packages: Django
  Found existing installation: Django 1.5
    Uninstalling Django:
      Successfully uninstalled Django
  Running setup.py install for Django

    warning: no previously-included files matching '__pycache__' found under directory '*'
    warning: no previously-included files matching '*.py[co]' found under directory '*'
    changing mode of /usr/local/bin/django-admin.py to 755
Successfully installed Django
Cleaning up...

但是如果我执行点击冻结,它会保持显示

but if I execute pip freeze, it keeps showing

Django == 1.5

Django==1.5

我做错了什么?

谢谢

推荐答案

这可以/应该/可以通过清除Django的构建目录来帮助。
自从版本1.1 查看详细信息有一个错误

This could/should/can be helped by clearing the build dir for Django in pip. There is a bug for this, since version 1.1 see here for details

如果您在OS X或类似系统的系统上,您可以在这里开始检查这些文件夹:

You can start checking for these folders here if you're on OS X or unix like systems:

~/.pip 
/tmp/pip-build-root (or pip-build-$USER, if you aren't running pip as root).

如果您在安装Django的第一个版本时尚未指定新的构建文件夹。

This is if you haven't specified a new build folder when you installed the first version of Django.

祝你好运!

这篇关于pip安装:如何强制一个特定的包版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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