创建requirements.txt,不包含@~~things



我想使用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:\~~~内容吗?或者我应该怎么解决这个问题?

谢谢。

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

最新更新