创建不带@~~事物的requirements.txt

Hyu*_*Lee 6 python pip requirements.txt conda

我想使用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'
Run Code Online (Sandbox Code Playgroud)

于是,我打开了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
~~~
Run Code Online (Sandbox Code Playgroud)

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

可以删除@ files:\\\~~~模块名称后面的东西吗?或者我应该做什么来解决这个问题?

谢谢。

G. *_*cia 7

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