jupyter查看python路径
时间: 2023-08-11 16:07:22 浏览: 416
要在Jupyter Notebook中查看Python路径,可以使用以下方法之一:
1. 在Jupyter Notebook中运行以下代码:
```python
import sys
print(sys.executable)
```
这将打印出当前Jupyter Notebook正在使用的Python解释器的路径。\[2\]
2. 在Jupyter Notebook中运行以下代码:
```python
import os
print(os.path.abspath('.'))
```
这将打印出当前Jupyter Notebook文件所在目录的绝对路径。\[3\]
请注意,这些方法都是在Jupyter Notebook中运行的,而不是在命令行或其他Python环境中运行。
#### 引用[.reference_title]
- *1* [如何给Jupyter添加python库路径](https://blog.csdn.net/C_chuxin/article/details/84994050)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Jupyter Notebook 中查看当前 运行哪个python](https://blog.csdn.net/xiaoyu20121221/article/details/84899934)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [[Python]( jupyter notebook)查询路径, 添加路径, 路径拼接, os模块](https://blog.csdn.net/QQi_coding/article/details/105926589)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文