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

elpy goto definition not working after activating virtual env #2011

Open
dnaeon opened this issue Feb 14, 2023 · 1 comment
Open

elpy goto definition not working after activating virtual env #2011

dnaeon opened this issue Feb 14, 2023 · 1 comment

Comments

@dnaeon
Copy link

dnaeon commented Feb 14, 2023

Summary

Hey, there! First, thanks for making elpy, much appreciated!

Steps to reproduce

  1. Open a .py file from existing project.
  2. M-. works as expected and I'm able to jump to the definitions within the project
  3. Activate a virtual env using M-x pyvenv-activate.
  4. M-. no longer works, even for symbols within the same project, which worked fine in step 2 before activating the environment
  5. Deactivate the virtualenv using M-x pyvenv-deactivate - jump to definition for symbols local to the project works again, but not for symbols within the virtualenv, e.g. a class provided by another package and located within the same venv

Something else to mention here -- M-x elpy-doc works fine, it's just that the jumping to definition does not.

Tried downgrading to jedi < 0.18 -- no change. Tried recreating the virtulaenv -- no change.

My configuration

OS

  • Arch Linux

Result of (elpy-config)

Elpy Configuration

Emacs.............: 28.2
Elpy..............: 1.35.0
Virtualenv........: venv (/home/dnaeon/Projects/../my-project/venv/)
Interactive Python: python3 3.9.5 (/home/dnaeon/Projects/.../my-project/venv/bin/python3)
RPC virtualenv....: rpc-venv (/home/dnaeon/.emacs.d/elpy/rpc-venv)
 Python...........: python 3.10.9 (/home/dnaeon/.emacs.d/elpy/rpc-venv/bin/python)
 Jedi.............: 0.18.2
 Autopep8.........: 2.0.1
 Yapf.............: 0.32.0
 Black............: 23.1.0
Syntax checker....: Not found (flake8)

Warnings

The configured syntax checker (flake8) could not be found. Elpy uses
this program to provide syntax checks of your code. You can either
install it, or select another one using `elpy-syntax-check-command`.

Elpy configuration in my init.el

(use-package elpy
  :ensure t
  :defer t
  :config
  (add-hook 'elpy-mode-hook (lambda () (highlight-indentation-mode -1)))
@yitang
Copy link

yitang commented Feb 17, 2023

you can check elpy-config with and without virtual env and see if there's any differences.

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