Go to definition in editor not working for files in user PYTHONPATH
See original GitHub issueIssue Report Checklist
- Searched the issues page for similar reports
- Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
- Reproduced the issue after updating with
conda update spyder
(orpip
, if not using Anaconda) - Could not reproduce inside
jupyter qtconsole
(if console-related) - Tried basic troubleshooting (if a bug/error)
- Restarted Spyder
- Reset preferences with
spyder --reset
- Reinstalled the latest version of Anaconda
- Tried the other applicable steps from the Troubleshooting Guide
- Completed the Problem Description, Steps to Reproduce and Version sections below
Problem Description
The “Go to definition” feature in the editor context menu, or CTRL+G, does not work on files that are in my own PYTHONPATH. It does however work on installed libraries and files I place myself in site-packages (on windows with Anaconda \AppData\Local\Continuum\anaconda3\Lib\site-packages).
What steps reproduce the problem?
- Create a file “myfileinpythonpath.py” with a method mymethod(), place it in a PYTHONPATH included path
- “from myfileinpythonpath import mymethod” works, but I can not use Go to definition to access the file/method
- Works as expected (opens the .py file) if I place the file in site-packages or try on another library, for example “import pathlib” and use Go to definition on pathlib
Versions
- Spyder version: 4.0.0rc1 (same problem also in b7)
- Python version: 3.7.4 64-bit
- Qt version: Qt 5.12.5
- PyQt version: PyQt5 5.12.3
- Operating System name/version: Windows 10
Running Kite if that matters.
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Visual Studio Code "Go To Definition" only works within the ...
I'm having some issues with the "Go To Definition" feature in Visual Studio Code and Python code. To note, I haven't tested with...
Read more >How Python search paths are applied - Visual Studio (Windows)
With typical Python usage, the PYTHONPATH environment variable (or IRONPYTHONPATH , etc.) provides the default search path for module files.
Read more >Editing Python in Visual Studio Code
Go to Definition (F12) jumps from your code into the code that defines an object. This command is helpful when you're working with...
Read more >Advanced Visual Studio Code for Python Developers
As a Python developer, a lot of the commands you'll use in Visual Studio Code are ... Open the Keyboard Shortcuts editor by...
Read more >Using PYTHONPATH — Functional MRI methods
Open Terminal.app ; · Open the file ~/.bash_profile in your text editor – e.g. atom ~/.bash_profile ; · Add the following line to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@goanpeca is working on this right now. It should be ready next week.
I have the same problem with the updated version of spyder. I am using spyder 5.3.0 :
Name Version Build Channel pyls-spyder 0.4.0 pyhd8ed1ab_0 conda-forge spyder 5.3.0 py39hcbf5309_0 conda-forge spyder-kernels 2.3.0 py39hcbf5309_0 conda-forge