PIP忽略了我在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']
)

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

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

$ pip install nineml --pre

另请参见pip文档中的说明。

最新更新