python - 创建 requirements.txt 没有 @ ~~ 的东西

标签 python pip conda 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:\\\~~~吗模块名称背后的东西或者我应该怎么做才能解决这个问题?
谢谢。

最佳答案

是的,删除 @ 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/

相关文章:

anaconda - 不同conda channel 的解释

当前 channel 不提供 Python 包

Python:如何改变字典值的子集?

python - 如何计算 DataFrame 对象中的类别数?

python - requests.exceptions.SSLError - 无法使用 python 模块

python - 无法在 Python 3.10 上安装 numba

python - 如何验证本地安装的模块版本是否是 pip 使用的版本?

python - 在现有的 python 系统上安装 anaconda?

python - 我无法在 WSL Ubuntu 上使用 pip

python - 将 networkx 图导出到 json 图文件的方法?