首页 > 解决方案 > 创建 requirements.txt 没有 @ ~~ 的东西

问题描述

我想使用pip freeze > requirements.txt命令创建 requirements.txt 并复制到 Google Drive 以在 Google Colab 中使用,但出现如下错误:

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

所以,我打开了requirements.txt,模块名后面有奇怪的东西开头@ files:\\\~~~

这是示例。

requirements.txt

~~~
jupyter-core==4.6.3
jupyterlab==2.2.6
jupyterlab-server @ file:///tmp/build/80754af9/jupyterlab_server_1594164409481/work
Keras==2.3.1
Keras-Applications @ file:///tmp/build/80754af9/keras-applications_1594366238411/work
Keras-Preprocessing==1.1.0
kiwisolver==1.2.0
~~~

我使用 Anaconda 安装了这些模块,并将其存储在我的名为“TensorFlow”的虚拟环境中。

可以删除@ files:\\\~~~模块名称后面的东西还是我应该怎么做才能解决这个问题?

谢谢。

标签: pythonpipcondarequirements.txt

解决方案


是的,删除@ files:\\\and 以供将来尝试conda list -e > requirements.txt而不是pip然后再次使用 conda 中的文件 so conda create --name <env> --file requirements.txt


推荐阅读