我想使用 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
.
关于python - 创建 requirements.txt 没有 @ ~~ 的东西,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63726290/