-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Use rope from non-virtualenv #901
Comments
I looked into it more and maybe these changes would be relevant? |
Thank you for your report, will look into this next week cause I'm busy right now with my personal things. |
Sorry for the delay. coc-pyright uses the detected Python, here is Will find a better way for this case, for now you need to install rope in venv. |
The new import codeAction won't depend on Rope. |
What's the output of
:CocCommand pyright.version
[coc.nvim] coc-pyright 1.1.296 with Pyright 1.1.298
What's the output of
:CocCommand workspace.showOutput Pyright
Workspace: /home/agentx3/projects/sandbox/python
Using python from /home/agentx3/projects/sandbox/python/venv/bin/python
[Info - 00:35:15.606] Pyright language server 1.1.298 starting
[Info - 00:35:15.607] Server root directory: /nix/store/qknanwbd9qgmal10myk8ixg7aagdnbd8-vimplugin-coc-pyright-1.1.296/node_modules/pyright/dist/
[Info - 00:35:15.609] Starting service instance "python"
[Info - 00:35:15.616] Starting service instance ""
[Info - 00:35:15.620] No configuration file found.
[Info - 00:35:15.620] No pyproject.toml file found.
[Info - 00:35:15.620] Setting pythonPath for service "python": "/home/agentx3/projects/sandbox/python/venv/bin/python"
[Warn - 00:35:15.624] stubPath /home/agentx3/projects/sandbox/python/typings is not a valid directory.
[Info - 00:35:15.644] Assuming Python version 3.10
[Info - 00:35:15.644] Assuming Python platform Linux
[Info - 00:35:15.703] Searching for source files
[Info - 00:35:15.704] Auto-excluding /home/agentx3/projects/sandbox/python/venv
[Info - 00:35:15.705] Found 1 source file
[Info - 00:35:15.706] No pyproject.toml file found.
[Info - 00:35:15.706] Setting pythonPath for service "": "/home/agentx3/projects/sandbox/python/venv/bin/python"
[Warn - 00:35:15.706] stubPath typings is not a valid directory.
[Info - 00:35:15.730] Assuming Python version 3.10
[Info - 00:35:15.730] Assuming Python platform Linux
[Info - 00:35:15.759] Searching for source files
[Info - 00:35:15.759] No source files found.
Short: Pyright tries to
import rope
from the virtualenv instead of the system python or the nvim python provider. It should either 1) look in those places instead or 2) look in those places in addition to the virtualenv.Context: If
rope
is not installed inside the virtualenv when trying to use the code actions for auto-imports, I get theModuleError Rope not installed
error.Extraneous Info:I noticed for certain packages nvim can pull from multiple places. Ex:
black
is called by the python provider ing:python3_host_prog
while mypy/pylint are called with the python packages available to the system python!python
. I found this out by installing rope in different places until it worked. Might be related to #344 (comment) It would be nice to not have to installrope
inside every virtualenv that I would like to userope
in. Also maybe worth noting that the virtualenv is getting activated once inside nvim regardless of whether or not the virtualenv was activated within the shell first.Many thanks
EDIT: More info:
Results of running
:python import rope
in nvimpython import rope
successThe text was updated successfully, but these errors were encountered: