commit
e07840fd02
11998
package-lock.json
generated
11998
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,27 @@
|
||||
---
|
||||
layout: doc
|
||||
---
|
||||
|
||||
# 常见问题解答
|
||||
|
||||
## 错误代码说明
|
||||
|
||||
### 32000 - MCP 连接失败
|
||||
|
||||
MCP 连接失败可能有多种原因,以下是一些常见情况:
|
||||
|
||||
• **虚拟环境路径不匹配**
|
||||
|
||||
虚拟环境(venv)与入口文件路径不匹配是导致连接失败的常见原因之一。
|
||||
|
||||
详细的解决方案请参考:[配置说明](./venv-not-same-path/venv-not-same-path.md)
|
||||
|
||||
---
|
||||
|
||||
• **其他可能的原因**
|
||||
|
||||
- 端口被占用
|
||||
- 环境变量配置错误
|
||||
- 依赖库未正确安装
|
||||
|
||||
> 如果您遇到以上问题,请先查看错误日志获取详细信息。如果问题仍然存在,可以在 [GitHub Issues](https://github.com/LSTM-Kirigaya/openmcp-client/issues) 中寻求帮助。
|
BIN
plugin-tutorial/faq/venv-not-same-path/image-2.png
Normal file
BIN
plugin-tutorial/faq/venv-not-same-path/image-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
BIN
plugin-tutorial/faq/venv-not-same-path/image.png
Normal file
BIN
plugin-tutorial/faq/venv-not-same-path/image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
29
plugin-tutorial/faq/venv-not-same-path/venv-not-same-path.md
Normal file
29
plugin-tutorial/faq/venv-not-same-path/venv-not-same-path.md
Normal file
@ -0,0 +1,29 @@
|
||||
# 虚拟环境与入口文件不在同一目录时的配置方式
|
||||
|
||||
## 问题描述
|
||||
|
||||
在使用 OpenMCP 时,有时会遇到虚拟环境(venv)与 Python 文件不在同一目录的情况,甚至虚拟环境可能位于项目文件夹之外。这种情况下,点击右上角连接按钮可能会出现 MCP 连接失败(错误代码:32000)的问题。
|
||||
|
||||
## 解决方案
|
||||
|
||||
### 1. 调整执行目录
|
||||
|
||||
在连接选项中,您需要调整执行目录到虚拟环境所在的位置:
|
||||
|
||||

|
||||
|
||||
### 2. 修改执行命令
|
||||
|
||||
同时,需要相应地修改执行命令:
|
||||
|
||||

|
||||
|
||||
### 3. 直接指定解释器路径
|
||||
|
||||
对于特定情况,您可以直接在命令中指定 Python 解释器的完整路径,例如:
|
||||
|
||||
```bash
|
||||
C:\code\ygo-chat\.venv\Scripts\python.exe example.py
|
||||
```
|
||||
|
||||
> 注意:此方法同样适用于 node或者mcp指令的【命令】以及其它mcp client的mcp配置文件。
|
Loading…
x
Reference in New Issue
Block a user