Flask部署上线中下载依赖环境出错(个人已解决)

我的行为:在11章部署上线操作中的

(env) $ pip install -r requirements.txt  # 安装所有依赖

出错
错误代码:

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/C:/ci/astroid_1592495992870/work'

通过查阅资料我知道这是在requirements.txt中有astroid @ file:///C:/ci/astroid_1592495992870/work
是由于在pip下载时中断导致
我的解决方案:删除requirements.txt所有带有@ File的行
总结原因:我是使用anaconda配置的环境,并且该环境之前用于配置机器学习的环境。
重新出发:使用anaconda配置新的环境,重新生成requirement.txt
新的问题:还是在bash环境中下载依赖错误代码为:

ERROR: Could not find a version that satisfies the requirement dataclasses==0.8 (from versions: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
ERROR: No matching distribution found for dataclasses==0.8

解决方案:vim requirements.txt 报错说的很清楚,降个版本的事
最后总结:非常好bug,使我的依赖旋转。

1 个赞