> For the complete documentation index, see [llms.txt](https://blog.cweihang.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.cweihang.io/python/libs.md).

# 常用库踩坑指南

* paramiko远程环境变量

  由于使用非交互模式ssh，不会加载\~/.bashrc或者/etc/profile中的环境变量，需要手动执行source，example:

```python
import paramiko
# 创建SSH对象
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname='222.201.145.236', port=22, username='hadoop', password='psw')
# 执行命令
stdin, stdout, stderr = ssh.exec_command('source /etc/profile\necho $PATH' )
# 获取命令结果
result = stdout.read()
print(result)
# 关闭连接
ssh.close()
```

* jupyter notebook启动

```
~/anaconda2/bin/jupyter notebook --ip=0.0.0.0 --port=8081
```

* 用ipdb在命令行里debug

<https://xmfbit.github.io/2017/08/21/debugging-with-ipdb/>

* pycuda安装，找不到cuda.h

> sudo pip3 install --global-option=build\_ext --global-option="-I/usr/local/cuda-10.0/targets/aarch64-linux/include/" --global-option="-L/usr/local/cuda-10.0/targets/aarch64-linux/lib/" pycuda


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.cweihang.io/python/libs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
