python - 一个 conda 环境自动在 jupyter notebook 中获取其他环境的依赖项
问题描述
我有两个名为 'myenv' 和 'newenv' 的 conda 环境,我在 myenv 中安装了 tensorflow,但没有在 newenv 中安装,在这两个环境中我都使用: pip install ipykernel 然后: python -m ipykernel install --user --name name_env --display-name "Python (name_env)" 我在两个环境中都这样做了,所以现在我的 jupyter notebook 中有 3 个内核,名为: Python(myenv),Python(newenv),Python3 。但是当更改为内核 newenv 并尝试导入 tensorflow 并且它导入但是我没有在 newenv 中安装 tensorflow 但是当我尝试通过 newenv 的命令终端导入它时,它显示错误“没有名为 tensorflow 的模块”。那为什么它在 jupyter notebook 中导入而不是在命令终端中?请帮我解决这个问题。
解决方案
推荐阅读
- r - 如何为 t 检验压缩多行代码?
- typescript - 如何动态处理类实例化
- video.js - HTML IMA SDK - 自定义点击
- asp.net - SignalR JavaScript 客户端 API 调用连接
- github - 如何将文件链接到不同/多个存储库?
- python-2.7 - Jinja2 中的宏不返回列表?
- spring-boot - 通过 HTTPS 公开 Google 计算引擎或 Kubernetes
- ruby - 制作一个根据可变长度插入空格的函数
- snowflake-cloud-data-platform - 如何在雪花中获取完整的功能表并测试它是否正常工作
- woocommerce - coupon_lines 在 woocommerce REST API 中不起作用?