python - pip install 无法从工件解析版本
问题描述
在 ubuntu 机器上使用pip install -r requirement.txt
(它有 avro-python3)安装时。我收到以下错误,它曾经是前一段时间的警告,但现在它导致错误。
Collecting avro-python3==1.9.2.1
Downloading https://artifactory/avro-python3-1.9.2.1.tar.gz (37 kB)
WARNING: Requested avro-python3==1.9.2.1 from https://artifactory/avro-python3-1.9.2.1.tar.gz#sha256=ca1e77a3da5ac98e8833588f71fb2e170b38e34787ee0e04920de0e9470b7d32 (from -r requirements.txt (line 4)), but installing version file-.avro-VERSION.txt
ERROR: Requested avro-python3==1.9.2.1 from https://artifactory/avro-python3-1.9.2.1.tar.gz#sha256=ca1e77a3da5ac98e8833588f71fb2e170b38e34787ee0e04920de0e9470b7d32 (from -r requirements.txt (line 4)) has different version in metadata: 'file-.avro-VERSION.txt'
我的 requirements.txt 看起来像
avro-python3==1.9.2.1
有没有办法避免这个错误?
为了解决它需要修复什么?
有没有办法可以在 requirements.txt 中指定?不为这个包使用神器?
解决方案
我avro-python3-1.9.2.1.tar.gz
从PyPI下载。它的setup.cfg
文件看起来像:
[metadata]
name = avro-python3
version = file: avro/VERSION.txt
description = Avro is a serialization and RPC framework.
...
注意版本行和file:
符号。这个符号是在setuptools 39.2.0中添加的:
因此,请确保您的setuptools版本至少为39.2.0,并且它可能会更好地工作(也许升级pip也会有所帮助)。
推荐阅读
- r - {knitr}在{DT}中嵌入图像并输出为pdf时弹出错误,请指教
- sql - 如何在 SQL Sever 中回填缺失的日期
- ios - SwiftUI Picker 不再适用于 Xcode 11 beta 7
- android - Android 将所有视图转移到另一侧
- django - 如何获取用户名而不是 id?
- memory - OpenCL 内存传输函数如何工作?
- react-native - EXPO : 将文件系统导出到文件,进入 android 文件夹
- jmeter - 虽然控制器完成后没有执行下一个线程
- c# - 绑定到页面上 UserControl 的自定义依赖属性不起作用
- apache-kafka - 由于突然终止,kafkastream 重新启动后未收到任何记录