-
Notifications
You must be signed in to change notification settings - Fork 37
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
Cannot persuade Black Formatter to forget old anaconda-based setup. #552
Comments
Quick note. As a (temporary?) work around, I was finally able to get it working by adding the following to settings.json on the remote side:
|
OK, and I've just had the same experience with the pylint VSCode extension, and the same fix worked. |
Hi, I had kind of the same problem but with pyenv tool. VSCode maintains internal caches of interpreters. I fixed the problem by:
|
Hi there,
Many thanks for responding. I think this did the trick! Many thanks!
Nathaniel
Nathaniel Livesey
Mail Stop 183-701, Jet Propulsion Laboratory
4800 Oak Grove Drive, Pasadena, California 91109.
Phone: +1 818 354-4214<tel:+18183544214> Cell: +1 818 219 6394
From: hourlier96 ***@***.***>
Date: Wednesday, January 8, 2025 at 6:32 AM
To: microsoft/vscode-black-formatter ***@***.***>
Cc: Livesey, Nathaniel J (US 3290) ***@***.***>, Author ***@***.***>
Subject: [EXTERNAL] Re: [microsoft/vscode-black-formatter] Cannot persuade Black Formatter to forget old anaconda-based setup. (Issue #552)
Hi,
I had kind of the same problem but with pyenv tool.
VSCode maintains internal caches of interpreters.
I fixed the problem by:
* Open Command Palette (Cmd+Shift+P).
* Select Python: Clear Workspace Interpreter Settings.
This will remove cached interpreter references for the current workspace, and so, black won't look for them anymore.
—
Reply to this email directly, view it on GitHub<https://urldefense.us/v3/__https:/github.com/microsoft/vscode-black-formatter/issues/552*issuecomment-2577816221__;Iw!!PvBDto6Hs4WbVuu7!PtHfHuWaAz-6429wtRhmeCfLSlaEK-DSCPkJGcC2Gw3X0koDweWsh2y1Ka_RHe1iyLq4R9QXX8DFL1QOZ65bSTMGFtnr4-Ct1iHR9w$>, or unsubscribe<https://urldefense.us/v3/__https:/github.com/notifications/unsubscribe-auth/AIX2AVIQVYHZRT73TCOLS332JUZFRAVCNFSM6AAAAABUQ4HFUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZXHAYTMMRSGE__;!!PvBDto6Hs4WbVuu7!PtHfHuWaAz-6429wtRhmeCfLSlaEK-DSCPkJGcC2Gw3X0koDweWsh2y1Ka_RHe1iyLq4R9QXX8DFL1QOZ65bSTMGFtnr4-DRa3pWvQ$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi! Seems resolved, please comment and I can reopen if not. Thanks |
Diagnostic Data
Behaviour
Expected Behavior
Black formatter to work as before (though I recall having problems making it work under anaconda)
Actual Behavior
I switched from anaconda to miniforge on my remote linux machine and the black-formatter doesn't work. When I do "Black Formatter: Restart Server" a window pops up saying:
The above path is the outdated (and removed) anaconda environment. I've tried switching from useBundled to fromEnvironment, no impact.
I've pasted the logs from when I do the "Restart Server" below. They seem clean and error-free enough to me.
Reproduction Steps:
Logs:
2025-01-02 17:21:27.723 [info] No interpreter found from setting black-formatter.interpreter
2025-01-02 17:21:27.723 [info] Getting interpreter from ms-python.python extension for workspace /users/livesey/python/lxgp
2025-01-02 17:21:27.725 [info] Interpreter from ms-python.python extension for /users/livesey/python/lxgp: /users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python
2025-01-02 17:21:27.725 [info] Workspace settings for /users/livesey/python/lxgp (client side): {
"cwd": "/users/livesey/python/lxgp",
"workspace": "file:///users/livesey/python/lxgp",
"args": [],
"path": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/black"
],
"interpreter": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python"
],
"importStrategy": "useBundled",
"showNotifications": "off"
}
2025-01-02 17:21:27.725 [info] No interpreter found from setting black-formatter.interpreter
2025-01-02 17:21:27.725 [info] Getting interpreter from ms-python.python extension for workspace /users/livesey/a-smls/asmls-gds
2025-01-02 17:21:27.725 [info] No interpreter found from setting black-formatter.interpreter
2025-01-02 17:21:27.726 [info] Getting interpreter from ms-python.python extension for workspace /users/livesey/python/dualpy
2025-01-02 17:21:27.727 [info] No interpreter found from setting black-formatter.interpreter
2025-01-02 17:21:27.727 [info] Getting interpreter from ms-python.python extension for workspace /users/livesey/proposals/roses-uaco-2024/figures-source
2025-01-02 17:21:27.727 [info] No interpreter found from setting black-formatter.interpreter
2025-01-02 17:21:27.727 [info] Getting interpreter from ms-python.python extension for workspace /users/livesey/python/lxgp
2025-01-02 17:21:27.727 [info] No interpreter found from setting black-formatter.interpreter
2025-01-02 17:21:27.727 [info] Getting interpreter from ms-python.python extension for workspace /users/livesey/python/madart
2025-01-02 17:21:27.728 [info] No interpreter found from setting black-formatter.interpreter
2025-01-02 17:21:27.728 [info] Getting interpreter from ms-python.python extension for workspace /users/livesey/python/mls-scf-tools
2025-01-02 17:21:27.728 [info] No interpreter found from setting black-formatter.interpreter
2025-01-02 17:21:27.728 [info] Getting interpreter from ms-python.python extension for workspace /users/livesey/python/moepy
2025-01-02 17:21:27.733 [info] Interpreter from ms-python.python extension for /users/livesey/a-smls/asmls-gds: /users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python
2025-01-02 17:21:27.733 [info] Workspace settings for /users/livesey/a-smls/asmls-gds (client side): {
"cwd": "/users/livesey/a-smls/asmls-gds",
"workspace": "file:///users/livesey/a-smls/asmls-gds",
"args": [],
"path": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/black"
],
"interpreter": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python"
],
"importStrategy": "useBundled",
"showNotifications": "off"
}
2025-01-02 17:21:27.733 [info] Interpreter from ms-python.python extension for /users/livesey/proposals/roses-uaco-2024/figures-source: /users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python
2025-01-02 17:21:27.733 [info] Workspace settings for /users/livesey/proposals/roses-uaco-2024/figures-source (client side): {
"cwd": "/users/livesey/proposals/roses-uaco-2024/figures-source",
"workspace": "file:///users/livesey/proposals/roses-uaco-2024/figures-source",
"args": [],
"path": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/black"
],
"interpreter": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python"
],
"importStrategy": "useBundled",
"showNotifications": "off"
}
2025-01-02 17:21:27.733 [info] Interpreter from ms-python.python extension for /users/livesey/python/lxgp: /users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python
2025-01-02 17:21:27.733 [info] Workspace settings for /users/livesey/python/lxgp (client side): {
"cwd": "/users/livesey/python/lxgp",
"workspace": "file:///users/livesey/python/lxgp",
"args": [],
"path": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/black"
],
"interpreter": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python"
],
"importStrategy": "useBundled",
"showNotifications": "off"
}
2025-01-02 17:21:27.733 [info] Interpreter from ms-python.python extension for /users/livesey/python/madart: /users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python
2025-01-02 17:21:27.733 [info] Workspace settings for /users/livesey/python/madart (client side): {
"cwd": "/users/livesey/python/madart",
"workspace": "file:///users/livesey/python/madart",
"args": [],
"path": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/black"
],
"interpreter": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python"
],
"importStrategy": "fromEnvironment",
"showNotifications": "off"
}
2025-01-02 17:21:27.733 [info] Interpreter from ms-python.python extension for /users/livesey/python/moepy: /users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python
2025-01-02 17:21:27.733 [info] Workspace settings for /users/livesey/python/moepy (client side): {
"cwd": "/users/livesey/python/moepy",
"workspace": "file:///users/livesey/python/moepy",
"args": [],
"path": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/black"
],
"interpreter": [
"/users/livesey/.conda/envs/njl-base-3.12-02jan25/bin/python"
],
"importStrategy": "useBundled",
"showNotifications": "off"
}
Outcome When Attempting Debugging Steps:
When I type "black <filename.py>" on the remote machine it runs fine.
Extra Details
As I say, I recall having to do something hard-coding like when I was running anaconda. Perhaps that's got stuck in its memory. However, I can find no references to the anaconda path in any of my settings.json files. Is there somewhere else I should look?
I installed this extension after having run an older black-like extension (I forget whose). Perhaps there's something lingering from that.
The text was updated successfully, but these errors were encountered: