python - 创建 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:\\\
and 以供将来尝试conda list -e > requirements.txt
而不是pip
然后再次使用 conda 中的文件 so conda create --name <env> --file requirements.txt
。
推荐阅读
- sql - 如何在 BigQuery 中加入 CTE 结果时更新表?
- model-view-controller - 使用 Azure AD 获取登录用户的员工 ID 字段
- azure - 带有事件网格触发器的 Azure 函数被调用了两次,而它只从其他 azure 函数发布了一次
- android - 最终用户是否可以访问在 iOS 和 Android 的 webview 上打开的 URL?
- clang-format - Clang-Format 不在头文件中缩进模板函数
- vue.js - Nuxt 生成的 HTML 和 JavaScript 并不适用于任何地方
- sql - 如何优化使用 GROUP BY 并连接多对多关系表的 SQL 查询?
- asp.net - 如何在 Visual Studio 中找到 CssClass 的源代码
- c# - 为什么 WebRequest.GetResponseAsync() 不是异步的?
- swift - 所有 WatchKit 应用程序在真实设备上启动时都会崩溃 - “警告:无法执行支持代码以读取 Objective-C 类数据”