差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

后一修订版
前一修订版
python:代码调试:python调试入手:python远程调试 [2025/12/18 09:10] – 创建 ctbotspython:代码调试:python调试入手:python远程调试 [2025/12/22 09:23] (当前版本) ctbots
行 33: 行 33:
 </code> </code>
  
 +可以配置bashrc 实现快速调试;
  
 +debugpy xxx.py 
  
 +或者  debugpy  端口号 xxx.py
 +
 +<code shell bashrc.sh>
 +debugpy() {
 +    local port=4005
 +    if [[ $1 =~ ^[0-9]+$ ]]; then
 +        port=$1
 +        shift
 +    fi
 +    python -m debugpy --listen 0.0.0.0:"$port" --wait-for-client "$@"
 +}
 +</code>
 +
 +
 +===== 可能遇到的问题 =====
 +<code>
 +packages/debugpy/adapter/../../typing.py", line 1007, in __new__
 +
 +    self._abc_registry = extra._abc_registry
 +
 +AttributeError: type object 'Callable' has no attribute '_abc_registry'
 +</code>
 +
 +兼容性问题,处理下 typing库
 +<code>
 +pip uninstall typing -y
 +pip install --upgrade typing-extensions
 +</code>