question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to clear python path cache

See original GitHub issue

Copy the workspace from another ssh server machine. The extension will try to load from the old path in source machine.

I tried

  • remove .vscode/settings.json
  • remove uninstall on windows and linux server
  • rm /home/victor/.vscode-server/extensions/ms-python.python-2020.8.101144 -r but the extension somehow still attempts to load python from the obsolete path, and the machine becomes very slow.

How can I clear the memory of python path

User belongs to experiment group 'AlwaysDisplayTestExplorer - control'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'DeprecatePythonPath - control'
User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaa'
Error 2020-08-14 10:29:03: Failed to create File hash for interpreter /home/victor/.local/share/virtualenvs/researchtools-V9CWtuou/bin/python [Error: ENOENT: no such file or directory, lstat '/home/victor/.local/share/virtualenvs/researchtools-V9CWtuou/bin/python'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/home/victor/.local/share/virtualenvs/researchtools-V9CWtuou/bin/python'
}
> conda --version
> conda info --json
> pyenv root
> python3.7 ~/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Error 2020-08-14 10:29:13: Failed to get interpreter information for '/home/victor/.local/share/virtualenvs/researchtools-V9CWtuou/bin/python' [Error: Command failed: "/home/victor/.local/share/virtualenvs/researchtools-V9CWtuou/bin/python" "/home/victor/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py" "/home/victor/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/interpreterInfo.py"
/bin/sh: /home/victor/.local/share/virtualenvs/researchtools-V9CWtuou/bin/python: No such file or directory

	at ChildProcess.exithandler (child_process.js:290:12)
	at ChildProcess.emit (events.js:200:13)
	at maybeClose (internal/child_process.js:1021:16)
	at Socket.<anonymous> (internal/child_process.js:430:11)
	at Socket.emit (events.js:200:13)
	at Pipe.<anonymous> (net.js:586:12)] {
  killed: false,
  code: 127,
  signal: null,
  cmd: '"/home/victor/.local/share/virtualenvs/researchtools-V9CWtuou/bin/python" ' +
    '"/home/victor/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py" ' +
    '"/home/victor/.vscode-server/extensions/ms-python.python-2020.8.101144/pythonFiles/interpreterInfo.py"'
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ericsnowcurrentlycommented, Aug 17, 2020

@Victsz, thanks for asking about this. Please run the following commands in the command palette:

  • Python: Clear Workspace Interpreter Setting
  • Python: Reset Stored Info for Untrusted Interpreters

Then let us know if that fixed it for you.

0reactions
ericsnowcurrentlycommented, Aug 20, 2020

It’s great to hear you worked this out! Sorry for the trouble. I expect the relevant persistent data was in C:\Users\Joe\AppData\Roaming\Code. Please let us know if there is anything else we can help you with.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How to flush interpreters list cache?
At last I found a way to remove no-longer existing interpreters from the cache : close VSCode; delete the virtualenv; launch VSCode and...
Read more >
Python clear cache
def clear_cache(site): """ Method to clear cached test cases """ confirm = input( 'Remove entire cache for site %s? (y/N) : ' %...
Read more >
Cleaning system cache | PyCharm Documentation
From the main menu, select File | Invalidate Caches/Restart. In the Invalidate Caches dialog, select the relevant action. You can invalidate the ...
Read more >
Modules are cached
Exit the REPL to refresh your cached Python modules​​ Python caches modules. So while developing your code as you're testing your code in...
Read more >
python - Clear cache files older than 30 minutes
for f in os.listdir(cache): # ... use_by = time.time() - 30 * 60 if os.path.getatime(f) < use_by: # ... Consider this:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found