spyder: Go to definition in editor not working for files in user PYTHONPATH
Issue 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.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (6 by maintainers)
@goanpeca is working on this right now. It should be ready next week.