创建没有@ ~~物品的

问题描述

我想使用pip freeze > requirements.txt命令创建requirements.txt,并复制到Google云端硬盘以在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