在Python编程中,是如下命令安装arrow依赖包时,
pip install -U arrow
发现如下ERROR:
![](https://img-blog.csdnimg.cn/20201117142147550.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3NhbnFpbWE=,size_16,color_FFFFFF,t_70#pic_center)
出现该问题原因是有2个,一是pip安装命令的末尾添加--use-feature=2020-resolver字段,二是需要安装two1 3.10.9所需的依赖包。
解决方法如下:
1)将黑框框代理requires信息拷贝到pack.txt中,如下:
//pack.txt
two1 3.10.9 requires base58==0.2.2, which is not installed.
two1 3.10.9 requires click==6.6, which is not installed.
two1 3.10.9 requires docker-py==1.8.0, which is not installed.
two1 3.10.9 requires flake8, which is not installed.
two1 3.10.9 requires jsonrpcclient==2.0.1, which is not installed.
two1 3.10.9 requires jsonrpcserver==3.1.1, which is not installed.
two1 3.10.9 requires mnemonic==0.13, which is not installed.
two1 3.10.9 requires path.py, which is not installed.
two1 3.10.9 requires pexpect, which is not installed.
two1 3.10.9 requires protobuf==3.0.0a3, which is not installed.
two1 3.10.9 requires pyaes, which is not installed.
two1 3.10.9 requires pytest, which is not installed.
2) 用notepad++打开上面的pack.txt,删除依赖包之外的字符串
2.1)删除requires到行首的字符串,
在Notepad++中,按Ctrl+H,勾选“正则表示式”,如下:
查找目标:
^.*(requires )
替换目标: 不填
点击[全部替换]。
![](https://img-blog.csdnimg.cn/20201117144642851.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3NhbnFpbWE=,size_16,color_FFFFFF,t_70#pic_center)
2.2)删除,逗号到行尾的字符串
查找目标:
\,.*$
替换目标: 不填
点击[全部替换]。
![](https://img-blog.csdnimg.cn/20201117144651749.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3NhbnFpbWE=,size_16,color_FFFFFF,t_70#pic_center)
得到如下:
![](https://img-blog.csdnimg.cn/20201117144705208.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3NhbnFpbWE=,size_16,color_FFFFFF,t_70#pic_center)
最后生成的pack.txt
base58==0.2.2
click==6.6
docker-py==1.8.0
flake8
jsonrpcclient==2.0.1
jsonrpcserver==3.1.1
mnemonic==0.13
path.py
pexpect
protobuf==3.0.0a3
pyaes
pytest
3)读取pack.txt,并进行安装
pip install -r pack.txt --use-feature=2020-resolver --default-timeout=10000
或者
pip3 install -r pack.txt -i http://mirrors.aliyun.com/pypi/simple/ --use-feature=2020-resolver --default-timeout=10000