Constantly fighting w/ "Couldn't refresh skeletons for remote interpreter"...
I've been using PyCharm for a number of years, mostly developing applications that live in docker containers.
This issue keeps surfacing, and is only fixed by a (random) combination of restarts, invalidating caches, deleting the pycharm_helpers image, and other wizardry. I end up wasting tremendous amounts of time getting things back to a working state.
Currently my environment is the latest versions of everything and everything is default settings and installation:
PyCharm 2023.1.3 (Professional Edition)
Docker Desktop for Mac 4.21.1 (114176)
Python 3.11.4
MacOS 13.4.1 (M2 Pro)
Essentially:
Project -> Python Interpreter: set to the correct Docker, compose file and python interpreter within the container. The list of packages installed in the container is correctly displayed in the window.
In notifications when opening the project I receive:
Couldn't refresh skeletons for remote interpreter
failed to run generator3/__main__.py for /usr/local/bin/python3, exit code 2, stderr: ----- Volume "process_ml_7269e68c-70c2-4802-960c-1e6178bdce4b" Creating Volume "process_ml_7269e68c-70c2-4802-960c-1e6178bdce4b" Created usage: generator3 [-h] [-d PATH] [-s PATH_LIST] [--name-pattern PATTERN] [--builtins-only] [--state-file PATH] [--init-state-file] [-q] [-v] [-V] [-S] [-z ARCHIVE] [-u ARCHIVE] [-c MODULES] [-p] [mod_name] [mod_path] generator3: error: argument --state-file: can't open '/tmp/3d23460e-c024-4625-aa89-b43a38a2de50/.state.json': [Errno 2] No such file or directory: '/tmp/3d23460e-c024-4625-aa89-b43a38a2de50/.state.json' -----
As a result, PyCharm redlines every native and third-party import and most native Python methods.
The most annoying thing is that it seems random - I will be working on a project without this issue, and the next time I open the project there it is - why???
请先登录再写评论。
Hello,
Please upload you logs folder zipped from ***Help | Collect logs and Diagnostic Data*** to the FTP
https://uploads.jetbrains.com/ and please let me know the filename.
Thank you in advance!
Hi, i've the same problem : failed to run generator3/__main__.py for /usr/bin/python3, exit code 2, stderr: ----- usage: generator3 [-h] [-d PATH] [-s PATH_LIST] [--name-pattern PATTERN] [--builtins-only] [--state-file PATH] [--init-state-file] [-q] [-v] [-V] [-S] [-z ARCHIVE] [-u ARCHIVE] [-c MODULES] [-p] [mod_name] [mod_path] generator3: error: argument --state-file: can't open '/tmp/607e7473-1d48-4de7-a579-6bade69472d6/.state.json': [Errno 13] Permission denied: '/tmp/607e7473-1d48-4de7-a579-6bade69472d6/.state.json' -----
I've tried several methods but can't seem to solve the problem.
on some projects I don't encounter the problem. possibly linked to the docker description?
have you been able to pinpoint the cause of the problem?
Thanks
Joaquimlozano , can you please provide logs from Help | Collect logs and Diagnostic Data ?
yes sure, how do you want me to send you the idea.log file?
Joaquimlozano , please upload you logs folder zipped from Help | Collect logs and Diagnostic Data to the FTP https://uploads.jetbrains.com/ and let me know the filename.
Thanks, filename : pycharm-logs-20231213-1447024913464552358657224.zip
Hi, I am also facing the same issue, hope the issue is resolved and if you can share any ideas on the fix, that would be really appricated.
failed to run generator3/__main__.py for /usr/local/bin/python3, exit code 2, stderr: ----- Volume "ops-kube-postgres_f1a579f4-6c5d-4e0d-91c4-062b94798ca1" Creating Volume "ops-kube-postgres_f1a579f4-6c5d-4e0d-91c4-062b94798ca1" Created usage: generator3 [-h] [-d PATH] [-s PATH_LIST] [--name-pattern PATTERN] [--builtins-only] [--state-file PATH] [--init-state-file] [-q] [-v] [-V] [-S] [-z ARCHIVE] [-u ARCHIVE] [-c MODULES] [-p] [mod_name] [mod_path] generator3: error: argument --state-file: can't open '/tmp/d526dd62-9ba2-4a0f-a5cc-c15d95d1aeac/.state.json': [Errno 2] No such file or directory: '/tmp/d526dd62-9ba2-4a0f-a5cc-c15d95d1aeac/.state.json' -----
Also got the related diagnose logs uploaded
Upload id: 2023_12_29_b9koPZeMwPhsvuDCqsUNtB (file: pycharm-logs-20231229-113252211823104560195212.zip)
Same here when using the flatpak version:
failed to run generator3/__main__.py for /usr/local/bin/python3, exit code 2, stderr: ----- /usr/lib/python3.12/site-packages/docopt.py:165: SyntaxWarning: invalid escape sequence '\S' name = re.findall('(\S*?>)', source)[0] /usr/lib/python3.12/site-packages/docopt.py:166: SyntaxWarning: invalid escape sequence '\[' value = re.findall('\[default: (.*)\]', source, flags=re.I) /usr/lib/python3.12/site-packages/docopt.py:207: SyntaxWarning: invalid escape sequence '\[' matched = re.findall('\[default: (.*)\]', description, flags=re.I) /usr/lib/python3.12/site-packages/docopt.py:456: SyntaxWarning: invalid escape sequence '\S' split = re.split('\n *(\S+?>|-\S+?)', doc)[1:] Creating volume "meldingen_66636508-f394-4714-ba42-0f065e8368d8" with default driver Creating meldingen_meldingen_run ... Creating meldingen_meldingen_run ... done usage: generator3 [-h] [-d PATH] [-s PATH_LIST] [--name-pattern PATTERN] [--builtins-only] [--state-file PATH] [--init-state-file] [-q] [-v] [-V] [-S] [-z ARCHIVE] [-u ARCHIVE] [-c MODULES] [-p] [mod_name] [mod_path] generator3: error: argument --state-file: can't open '/tmp/0827f2b0-5009-4f45-8d31-cc3b53451f96/.state.json': [Errno 2] No such file or directory: '/tmp/0827f2b0-5009-4f45-8d31-cc3b53451f96/.state.json' 2 -----
I'm invalidating cache, restarting, removing .idea folder, removing pycharm helper container, removing and re-adding interpreter, nothing seems to help. This was working fine just yesterday, at least for this project, it was having the same issues with another project.
Considering I have a license for the Professional edition and use this for my actual work, I would expect this to get fixed ASAP.
Multiple people have already provided their logs, and problems with the skeleton refreshing/generation have existed for years now. Perhaps there is a better solution?
Also it is quite obvious what the problem is here, the state file does not exist, which seems like an optional argument to that command, is there a way to change the configuration so that it does not add that argument or something? Then at least we'd have a workaround for the problem for now.
Hello,
I'm getting the same error.
failed to run generator3/__main__.py for /opt/bb/bin/python3.10, exit code 2, stderr: ----- usage: generator3 [-h] [-d PATH] [-s PATH_LIST] [--name-pattern PATTERN] [--builtins-only] [--state-file PATH] [--init-state-file] [-q] [-v] [-V] [-S] [-z ARCHIVE] [-u ARCHIVE] [-c MODULES] [-p] [mod_name] [mod_path] generator3: error: argument --state-file: can't open '/tmp/6961dab1-3f68-4619-9b19-8ce7061fa020/.state.json': [Errno 2] No such file or directory: '/tmp/6961dab1-3f68-4619-9b19-8ce7061fa020/.state.json' -----
Same issue here, never goes away when trying to add a remote python interpreter. I have removed orphans multiple times. Here is the link to the logs: Upload id: 2024_10_18_fJ8VYGCG4zrY56ZTjqjfG9 (file: pycharm-logs-20241018-10551117630549958663291350.zip)
Hi Ggray34, Alex, the issue looks similar to PY-55679. Is the workaround from this comment of any use for your config?
I'm also having the same issue and the fix from PY-55679 doesn't work for me.
It's the third time this year that I've been unable to use PyCharm for a couple of days because of similar issues. It stops being acceptable especially for the PRO version.
Please create a separate issue on YouTrack on this matter so we can properly process it.