Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leader ac import error #949

Closed
THtianhao opened this issue Jun 12, 2023 · 6 comments
Closed

leader ac import error #949

THtianhao opened this issue Jun 12, 2023 · 6 comments
Assignees

Comments

@THtianhao
Copy link

What's the output of :CocCommand pyright.version
coc-pyright 1.1.310 with Pyright 1.1.311

What's the output of :CocCommand workspace.showOutput Pyright

Workspace: /Users/toto/Project/MyProject/ai_video_generate
Using python from /Users/toto/Project/MyProject/ai_video_generate/venv/bin/python

[Info  - 17:23:45.722] Pyright language server 1.1.311 starting
[Info  - 17:23:45.722] Server root directory: /Users/toto/.config/coc/extensions/node_modules/coc-pyright/node_modules/pyright/dist/
[Info  - 17:23:45.727] Starting service instance "ai_video_generate"
[Info  - 17:23:45.741] Setting pythonPath for service "ai_video_generate": "/Users/toto/Project/MyProject/ai_video_generate/venv/bin/python"
[Warn  - 17:23:45.747] stubPath /Users/toto/Project/MyProject/ai_video_generate/typings is not a valid directory.
[Info  - 17:23:45.792] Assuming Python version 3.10
[Info  - 17:23:45.905] Auto-excluding /Users/toto/Project/MyProject/ai_video_generate/venv
[Info  - 17:23:45.906] Found 2 source files

when I type ac ,show follow hint
image
and occur [coc.nvim] Module rope not installed
how do i fix this import error

@THtianhao
Copy link
Author

哥我才发现你是中国人,交流方便多了,
1.我看他们说自动补全的时候可以自动import,但是我没有。
2.还有就是cocrunaction的时候老是提示repo没安装,但是我在虚拟环境中已经安装了,是不是需要做其他的配置呢?

@fannheyward
Copy link
Owner

  1. Pyright 是支持补全时自动 import 的,比如你输入 redis 自动补全会有。但并不是全部 module,比如 os 就没有
  2. coc-pyright 是通过 rope 做的半自动补全,效果没那么智能。需要在你当前项目的 python 环境中安装。你看看 /Users/toto/Project/MyProject/ai_video_generate/venv/bin/python -c "import rope" 是否OK
image

@fannheyward
Copy link
Owner

rope 找不到应该是环境不一致 #901

@THtianhao
Copy link
Author

太激动了,感谢哥的回复!你看哥我pip是安装上的,但是import就找不到,我是哪弄错了吗?
image

@fannheyward
Copy link
Owner

image

你安装错了,rope, 不是 repo

@THtianhao
Copy link
Author

谢谢哥,这种低级错误真的是没脸见人了= =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants