Can't upload helpers for remote interpreter PyCharm2020.1
I am connecting to a remote computer using SSH and I managed to do that properly thanks to the UI: the connection is successful. I have a problem though:
Couldn't upload helpers for remote interpreter: File C:\Users\<USERNAME>\AppData\Local\JetBrains\PyCharm2020.1\remote_sources\1290613867\1718042274\.pycharm_helpers\packaging_tool.py is not a file or directory
The helpers are not uploading to the remote host, but I'm not sure what to do. Any help would be appreciated.
PS: I can run programs and code completion is working, but the fact that the error shows up every time is annoying
Please sign in to leave a comment.
Hi,
Please try:
1. Delete ~/.pycharm_helpers from the remote host
2. Do **File | Invalidate Caches / Restart... | Invalidate and Restart**
3. Delete and recreate the project interpreter
Then, run your script, make sure the new ~/.pycharm_helpers directory appears on the remote host. Does the issue still reproduce afterwards?
Seems to be working, but only after I mapped ~/.pycharm_helpers and the remote code in a tmp directory, different from my user one. Is there a way to make sure it works also for my user directory or could there be an accessing problem to this latter directory?
Default path for helpers is ~/.pycharm_helpers , which is inside your user's home. Does it not being uploaded there? In this case, this is most likely a permission issue. You should see "permission denied" error if you look in the logs.
I suggest reviewing permissions for your user. You can also try uploading them manually via SSH to test the permission. Or you can just copy them from tmp to ~
When I was leaving the deafult settings it was creating the folder in ~/, but when I then tried to run the program it would give the error aforementioned. Only after I mapped the helpers directory into the tmp folder I was error-free.
In my experience this always happens, when you use the PyCharm inbuild functionality to install new libraries (e.g. NumPy on the remote machine). It does not break if I install the libraries via ssh console using pip. I can imagine that the PyCharm Helper (I think that's this Package managing thing called) breaks somehow the permissions or some stuff.
I have a similar problem and have done the cache invalidation and it doesn't help. This happens on all conda virtual environments on a SSH remote host. I use PyCharm 2020.2 on Windows. Here is a snipit of the log:
2020-09-14 18:21:45,327 [ 249669] INFO - plugins.remotesdk.RemoteUpload - Uploading helpers to /home/ryan/.pycharm_helpers
2020-09-14 18:21:45,328 [ 249670] INFO - .channel.direct.SessionChannel - Will request `sftp` subsystem
2020-09-14 18:21:45,641 [ 249983] WARN - om.intellij.ssh.impl.sshj.sshj - File C:\Users\rshef\AppData\Local\JetBrains\PyCharm2020.2\remote_sources\-481361872\1427634325\.pycharm_helpers\packaging_tool.py: C:\Users\rshef\AppData\Local\JetBrains\PyCharm2020.2\remote_sources\-481361872\1427634325\.pycharm_helpers\packaging_tool.py is not a file or directory
java.io.IOException: C:\Users\rshef\AppData\Local\JetBrains\PyCharm2020.2\remote_sources\-481361872\1427634325\.pycharm_helpers\packaging_tool.py is not a file or directory
at net.schmizz.sshj.sftp.SFTPFileTransfer$Uploader.upload(SFTPFileTransfer.java:189)
at net.schmizz.sshj.sftp.SFTPFileTransfer$Uploader.access$100(SFTPFileTransfer.java:166)
at net.schmizz.sshj.sftp.SFTPFileTransfer.upload(SFTPFileTransfer.java:64)
at net.schmizz.sshj.sftp.SFTPClient.put(SFTPClient.java:244)
at com.intellij.ssh.impl.sshj.channels.SshjSftpChannel.uploadFileOrDir(SshjSftpChannel.kt:33)
at com.intellij.ssh.channels.SftpChannel$DefaultImpls.uploadFileOrDir(SftpChannel.kt:22)
at com.intellij.ssh.impl.sshj.channels.SshjSftpChannel.uploadFileOrDir(SshjSftpChannel.kt:19)
at com.jetbrains.plugins.remotesdk.RemoteUpload.uploadPerFile(RemoteUpload.kt:148)
at com.jetbrains.plugins.remotesdk.RemoteUpload.doUploadFilesToRemote(RemoteUpload.kt:125)
at com.jetbrains.plugins.remotesdk.RemoteUpload.access$doUploadFilesToRemote(RemoteUpload.kt:31)
at com.jetbrains.plugins.remotesdk.RemoteUpload$process$1.run(RemoteUpload.kt:43)
at com.jetbrains.plugins.remotesdk.RemoteUploadKt$createTask$1.run(RemoteUpload.kt:221)
at com.jetbrains.plugins.remotesdk.RemoteUpload$upload$1.run(RemoteUpload.kt:54)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1728)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
2020-09-14 18:21:45,642 [ 249984] INFO - .diagnostic.PerformanceWatcher - Helpers uploaded took 35ms; general responsiveness: ok; EDT responsiveness: ok
This whole helper uploading is extremely annoying and I still would like to see JetBrains stopping that completely. It is an unneccessary burden and there a already a lot of complaints about it since years (!).
Hi, exact same problem as the OP and Ryan. Can run python files but console keeps trying to connect, but nothing happens. Using version 2021.1.1. Any help would be much appreciated. Andrey Resler
I have just spent an hour screwing around with that and realized that the solution is to choose SSH when configuring the Python Interpreter (takes no more than 10 clicks to get there...). By default, mine was set to Deployment configuration. Seriously, guys, can't this be made a bit more obvious?
Thanks Valery! I moved host info into my .ssh/config. The ssh config could connect fine, but the helper upload was failing until I changed the config to use SSH instead of Deployment Config.
Well, just when we thought we figured this out... I have upgraded to version 2021.3, and lo and behold -- a similar error, only this time my interpreter is configured as SSH, and the connection test succeeds. The exact error is slightly different, but the result is the same.
Any help from JetBrains here would be highly appreciated. I have already tried everything I could think of.
Hi, I would suggest updating to the 2022.1, and removing/re-adding from scratch the SSH interpreter. If this doesn't help, could you please submit a bug report to https://youtrack.jetbrains.com/issues/py with Logs from **Help | Collect Logs and Diagnostic Data** after reproducing the issue, so we could take a look?