Improvements to clearing of cached interpreter name
See original GitHub issueCurrently the display names of interpreters are cached for a period of 1day. This is done to avoid unnecessarily spawning Python processes for each interpreter every time the extension loads (i.e. every time a new workspace is opened or VSC is reloaded). Note: The cache also expires if the python executable file has changed since the last reload.
However, this can cause some confusions:
- Assume user has python 3.6 installed in a directory named
/anaconda3/bin
- Next user updates the above environment to python 3.7.
- Our code does not detect any changes to the above executable and the path is still the same.
- Hence the cached display name is still used (and its incorrect, user sees
3.6
when its supposed to be3.7
). *** This confuses the user**
Solutions:
- Remove caching of these display names completely
- We’ll end up spawning processes unnecessarily every time VSC loads
- Add some kind of the UI element to the top of the list of interpreters
- This would read
Don't find what you're looking for, click Refresh [Refresh]
- Basically this is a way to tell the extension to re-load all interpreters and clear the cache
- This also solves the problem of the user NOT having to reload VS Code if they create a new environment (e.g. a new Conda Environment or the like).
- This would read
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:12
Top Results From Across the Web
Prevent Python from caching the imported modules
I would like something like that. A good alternative would be for IPython to restart, or restart the Python interpreter somehow. So, if...
Read more >Caching in GitLab CI/CD
Each time you clear the cache manually, the internal cache name is updated. The name uses the format cache-<index> , and the index...
Read more >Clearing cache via UI in translated language resets config ...
Problem/Motivation. I translated field labels through the configuration translation module UI. When I create a node and then translate it ...
Read more >Modules are cached - Python Morsels
How to clear the cache for a module. This module caching that Python does is a feature, not a bug: Python does this...
Read more >VS Code Tip | How to delete cached data files - YouTube
In this tutorial we are going to learn how to clear the cache content in Visual Studio Code in case if your VS...
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
I have solved this problem, use the following method: manage extensions > disable Python extension > restart > enable python extension> restart then all python envs have been flushed(invalid pythonpath disappeared and new pythonpath displayed)
Thanks for your answer. I described my problem here: https://github.com/Microsoft/vscode-python/issues/4298 Basically when I run
Python: Select Interpreter
environments that do not exist anymore are shown and vscode crashes.