Python redis-log error



我正在尝试将我的 python 项目设置到我的本地 Fedora 16 机器上。我使用 git 克隆了整个项目。

项目使用 redis 服务器。

输入命令后:python setup.py 开发 我收到以下错误

Installed /usr/lib/python2.7/site-packages/python_redis_log-0.1.2-py2.7.egg
error: Could not find required distribution python-redis-log>=9999

我已经安装了 Redis 2.7

有人知道这里有什么问题吗?非常感谢帮助。

画中点冻结

tawlk]# pip freeze
IPy==0.75
Magic-file-extensions==0.2
Paste==1.7.5.1
PyYAML==3.10
SSSDConfig==1
Tempita==0.4
chardet==2.0.1
cupshelpers==1.0
decorator==3.3.2
distribute==0.6.24
ethtool==0.7
eventlet==0.9.17
firstboot==1.117
gps==2.95
greenlet==0.4.0
iniparse==0.4
iwlib==1.1
kitchen==1.0.0
-e git+https://github.com/Tawlk/kral.git@d1b8aacc3a2fa8c80049c392014842ed2f547f0d#egg=kral-dev
liveusb-creator==3.11.4
lockfile==0.9.1
lxml==3.0.1
nltk==2.0.4
numpy==1.6.2
policycoreutils-default-encoding==0.1
pyOpenSSL==0.12
pycryptsetup==0.1.4
pycups==1.9.59
pycurl==7.19.0
pygpgme==0.1
pykickstart==1.99.4
pyparted==3.8
python-bugzilla==0.6.2
python-meh==0.11
python-nss==0.12
python-redis-log==0.1.2
python-redis-logger==0.1.3
redis==2.7.2
scdate==1.9.67
scservices==0.101.7
scservices.dbus==0.101.7
sesearch==1.0
setools==1.0
setroubleshoot-default-encoding==0.1
simplejson==2.1.6
slip==0.2.17
slip.dbus==0.2.17
slip.gtk==0.2.17
sockjs-tornado==0.0.5
spambayes==1.1a6
stevedore==0.7.2
-e git+https://github.com/Tawlk/synt.git@570cfcdedbc9734489ee737eb5f95de73a494ab6#egg=synt-dev
-e git+https://github.com/Tawlk/tawlk.git@bd420f7a4cc33a58d3d3ecf9342ab650dd810b5e#egg=tawlk-dev
tornado==2.4.1
urlgrabber==3.9.1
virtualenv==1.8.4
virtualenv-clone==0.2.4
virtualenvwrapper==3.6
wsgiref==0.1.2
yolk==0.4.3
yum-langpacks==0.2.2
yum-metadata-parser==1.1.4
yum-presto==0.4.4

谢谢

问题是安装程序工具正在查找至少具有指定版本号的所需包。 9999 大于 2.7.2,因此它会尝试下载 setup.py 文件中指定的版本。

install_requires关键字的官方文档在这里

The simplest way to include requirement specifiers is to use the install_requires argument to setup(). It takes a string or list of strings containing requirement specifiers. If you include more than one requirement in a string, each requirement must begin on a new line.

下面描述了需求说明符:

setuptools and pkg_resources use a common syntax for specifying a project’s required dependencies. This syntax consists of a project’s PyPI name, optionally followed by a comma-separated list of “extras” in square brackets, optionally followed by a comma-separated list of version specifiers. A version specifier is one of the operators <, >, <=, >=, == or !=, followed by a version identifier. Tokens may be separated by whitespace, but any whitespace or nonstandard characters within a project name or version identifier must be replaced with -.

特别是为了解决您的问题:

您的 setup.py 文件具有

install_requires = [ ...
                     'python-redis-log>=9999'

您拥有的版本说明符是 python-redis-log>=9999 ,因此您的项目要求 python-redis-log 的版本号为 9999 或更高。

如果将该行更改为

python-redis-log>=0.1.2

这应该可以解决问题。

如果我

有足够的声誉点,我会发表评论。

error: Could not find required distribution python-redis-log>=9999

这表明它正试图通过至少 9999 的版本来满足python-redis-log的要求。当前安装的版本是 0.1.2

请粘贴setup.py的"requires"部分或任何定义依赖项的地方。

如果你想保持一个干净的Python环境,而不是一直处理冲突,我总是建议使用virtualenv。该程序允许您创建一个单独的 Python 环境,您可以在其中安装软件包,而不会让它们与发行版中包含的软件包冲突。

这可能不会解决您的>=9999,但它是一个很好的工具。我建议你尝试制作一个虚拟环境,看看你是否遇到同样的问题。

最新更新