Pip忽略了我在PyPI上的最新版软件包

时间:2017-11-22 22:09:36

标签: python pip setuptools

我最近向PyPI上传了一些我正在处理的名为nineml的Python软件包。通过PyPI网站(https://pypi.python.org/pypi/nineml)导航到 nineml 会带我到最新版本(1.0rc2)。但是,当我尝试使用pip安装它时,只发现最旧的版本(0.1),尽管它与Python 3不兼容(Python 2.7也会出现这个问题)。

查看详细输出(下方)pip似乎找到了较新版本的链接,但未将其包含在版本列表中

(nineml-test3) tclose@potassium:~$ python --version
  Python 3.6.2
(nineml-test3) tclose@potassium:~$ pip install -vvv nineml
Collecting nineml
  1 location(s) to search for versions of nineml:
  * https://pypi.python.org/simple/nineml/
  Getting page https://pypi.python.org/simple/nineml/
  Looking up "https://pypi.python.org/simple/nineml/" in the cache
  Current age based on date: 140
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The response is "fresh", returning cached response
  600 > 140
  Analyzing links from page https://pypi.python.org/simple/nineml/
    Found link https://pypi.python.org/packages/18/25/67fcf106b63c515e86b41c579809fbdee6468abc2b0efba497017da087d8/nineml-1.0rc1-py2.py3-none-any.whl#md5=ca3c30a777e443069c9d6d60a3f819f6 (from https://pypi.python.org/simple/nineml/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4), version: 1.0rc1
    Found link https://pypi.python.org/packages/26/a8/42ad4062d40f7e1c71d6195814d47a9b8a4c55b310f9d1d943a7a57d6a36/nineml-1.0rc2-py2.py3-none-any.whl#md5=94497e8caf47f38240dcd1bc703ffd52 (from https://pypi.python.org/simple/nineml/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4), version: 1.0rc2
    Skipping link https://pypi.python.org/packages/2d/6f/573b71c04f891d968f44efd86a87b457072d5a92d4364c6e8a6420560f83/nineml-0.1-py2-none-any.whl#md5=6d7e0dee64e4bc181b141044368997b0 (from https://pypi.python.org/simple/nineml/); it is not compatible with this Python
    Found link https://pypi.python.org/packages/3c/da/844e823a9b932041b880414896759502697bff369d3b5f33c9b0d53f2b76/nineml-0.1.tar.gz#md5=fd0f8c6d90aed2fe6b1bc8a696a85eff (from https://pypi.python.org/simple/nineml/), version: 0.1
    Found link https://pypi.python.org/packages/40/ad/dc65fd215c717c92119149104371b56b74aa32e1b1fecfef5637af467cb7/nineml-1.0rc1.tar.gz#md5=91fe5e41c89309803c036981362dd94e (from https://pypi.python.org/simple/nineml/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4), version: 1.0rc1
    Found link https://pypi.python.org/packages/b7/9e/f2611491478af2ecd55c74ac2ef8adf825be6d327916043b4abe910dd051/nineml-1.0rc2.tar.gz#md5=fb580237a2a156f8559420c23547812d (from https://pypi.python.org/simple/nineml/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4), version: 1.0rc2
  Using version 0.1 (newest of versions: 0.1)
  Looking up "https://pypi.python.org/packages/3c/da/844e823a9b932041b880414896759502697bff369d3b5f33c9b0d53f2b76/nineml-0.1.tar.gz" in the cache
  Current age based on date: 169019
  Freshness lifetime from max-age: 31557600
  The response is "fresh", returning cached response
  31557600 > 169019
  Using cached nineml-0.1.tar.gz
  Downloading from

我认为我的setup.py非常简单

#!/usr/bin/env python

from setuptools import setup, find_packages

setup(
    name="nineml",
    version="1.0rc2",
    packages=find_packages(),
    # add your name here if you contribute to the code
    author="Andrew P. Davison, Thomas G. Close, Mike Hull, Eilif Muller",
    author_email="myemail@gmail.com",
    description=(
        "A tool for reading, writing and generally working with 9ML objects "
        "and files."),
    long_description=open("README.rst").read(),
    license="BSD 3 License",
    keywords=("computational neuroscience modeling interoperability XML YAML"
              "HDF5 JSON"),
    url="http://nineml-python.readthedocs.io",
    classifiers=['Development Status :: 4 - Beta',
                 'Environment :: Console',
                 'Intended Audience :: Science/Research',
                 'License :: OSI Approved :: BSD License',
                 'Natural Language :: English',
                 'Operating System :: OS Independent',
                 'Programming Language :: Python :: 2',
                 'Programming Language :: Python :: 2.7',
                 'Programming Language :: Python :: 3',
                 'Programming Language :: Python :: 3.4',
                 'Programming Language :: Python :: 3.5',
                 'Programming Language :: Python :: 3.6',
                 'Topic :: Scientific/Engineering'],
    install_requires=['lxml>=3.7.3',
                      'future>=0.16.0',
                      'h5py>=2.7.0',
                      'PyYAML>=3.1',
                      'sympy>=1.1'],
    python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',
    tests_require=['nose', 'numpy']
)

知道为什么它忽略了最新版本吗?

1 个答案:

答案 0 :(得分:1)

这是因为rc2后缀。默认情况下,pip将仅安装软件包的稳定版本。您的上一个稳定版本为0.1,而所有带有后缀devXrcX的版本都不会被视为稳定版。您可以通过添加--pre选项来覆盖此选项:

$ pip install nineml --pre

See also the explanation in pip docs