【问题标题】:Pip: could not find a version. No matching distribution foundPip:找不到版本。找不到匹配的分布
【发布时间】:2017-08-16 16:26:05
【问题描述】:

我正在尝试安装 Flask-ACL: https://mikeboers.github.io/Flask-ACL

$ pip search acl | grep -i flask

Flask-ACL (0.0.1) - Access control lists for Flask.
flask-miracle-acl (0.2) - The fabric between the Flask framework and Miracle ACL

Flask-Sandbox (0.1.0)- ACL Route controls for Flask
Flask-SimpleACL (1.2)- Simple ACL extension


$ pip install Flask-ACL

Collecting Flask-ACL
Could not find a version that satisfies the requirement Flask-ACL (from versions: )
No matching distribution found for Flask-ACL

这里有什么问题?

附: Pip 几分钟前已升级。

更新:

$ python --version
Python 2.7.3

我在 virtualenv 下运行它。

pip install -Iv Flask-ACL

Collecting Flask-ACL
1 location(s) to search for versions of Flask-ACL:
* https://pypi.python.org/simple/flask-acl/
Getting page https://pypi.python.org/simple/flask-acl/
Looking up "https://pypi.python.org/simple/flask-acl/" in the cache
Current age based on date: 507
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
The response is "fresh", returning cached response
600 > 507
Analyzing links from page https://pypi.python.org/simple/flask-acl/
Could not find a version that satisfies the requirement Flask-ACL (from versions: )

正在清理... 找不到 Flask-ACL 的匹配分布

如我所见,Pypi 上没有这样的包:

https://pypi.python.org/simple/flask-acl/

但是这个存在:

https://pypi.python.org/pypi/Flask-ACL

我的pip 有什么问题?

【问题讨论】:

    标签: python pip packages


    【解决方案1】:

    此类错误的更常见原因可能是您的环境不符合包的要求。

    例如,如果您的环境的 Python 版本与包指定的所需 Python 版本不匹配,则会发生这种情况:

    (my_python36_env)> pip install package_that_requires_python37
    
    ERROR: Could not find a version that satisfies the requirement package_that_requires_python37.
    ERROR: No matching distribution found for package_that_requires_python37.
    

    【讨论】:

      【解决方案2】:

      我在 anaconda 中安装了烧瓶,但是使用它导入它时出现了一些问题

      from tensorflow.keras.applications.imagenet_utils import preprocess_input, decode_predictions

      所以我把上面的命令改成了

      from tensorflow.python.keras.applications.imagenet_utils import preprocess_input, decode_predictions

      效果很好

      【讨论】:

        【解决方案3】:

        注意您的文件~/.pip/pip.conf 是否不包含任何其他index-url 值。 然后它可以尝试在存储库中查找不存在的特定包版本。

        一些解决方法是删除 pip.conf

        【讨论】:

          【解决方案4】:

          Flask-ACL 的开发者犯了一个错误,他们没有设法将 Flask-ACL 库上传到 PyPi(其中 pip 搜索模块)。所以你必须使用他们 GitHub 页面上的 pip 安装它。

          你可以这样做:

          pip install "git+https://github.com/mikeboers/Flask-ACL"
          

          【讨论】:

          • 我确实知道这个解决方法,但是我可以像其他包一样使用pip install 安装它而不使用直接链接吗?
          • 如果您查看pypi.python.org/pypi/Flask-ACL,则没有指向它的 .whl 链接。
          • 这是问题的根源吗?
          • 在我看来,是的
          • 好的,听起来很现实。如果我没有其他解释,我会接受你的回答。
          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2021-03-26
          • 2018-12-16
          • 2020-07-15
          • 2019-12-23
          • 2018-02-08
          • 2017-10-08
          • 2017-05-05
          相关资源
          最近更新 更多