Any way to force a refresh of external libraries on a remote interpreter?
Answered
Certainly I'm not the only one who's encountered this.
I have a remote interpreter (ssh), which is also the project interpreter, filled in from deployment settings. I upgraded one of the libraries on the server, but the stubs PyCharm shows in the external libraries section is still the old version. I tried deleting the remote interpreter and recreating it, but unfortunately it seems to have just reused a cached version of the stubs.
What I need is for PyCharm to realize that the file is updated. I can look at a file in PyCharm, and see that it's simply not been updated.
Is there a way to purge PyCharm's cache of libraries on a remote interpreter?
I have a remote interpreter (ssh), which is also the project interpreter, filled in from deployment settings. I upgraded one of the libraries on the server, but the stubs PyCharm shows in the external libraries section is still the old version. I tried deleting the remote interpreter and recreating it, but unfortunately it seems to have just reused a cached version of the stubs.
What I need is for PyCharm to realize that the file is updated. I can look at a file in PyCharm, and see that it's simply not been updated.
Is there a way to purge PyCharm's cache of libraries on a remote interpreter?
Please sign in to leave a comment.
1) open file->settings->remote interpreter
2) click the cog next to the remote interpreter name and select more
3) in the window that pops up, click the bottom button on the right (looks like a 3 item list sitting on top of a folder)
4) in the window that pops up there, click the refresh button on the right
The process that starts now will presumably fail if your setup is similar to mine, but should succeed otherwise.
Similar issue. Updated some project dependencies in a remote virtualenv, but still seeing the old code in the PyCharm IDE under "External Libraries"
Clicking the refresh button for that library in the window dal mentioned above doesn't do anything. (Doesn't even cause the IDE to cycle or show a message.)
Hmm....
Any update on this?
I'm having the exact same issue. Is there a way to resolve this?
The only way I was able to "resolve" the issue was to:
Hey Adrian, could you be a little more specific what you've done?
I suffer the same issue and couldn't solve it so far...
ok deleting the remote interpreter, restarting pycharm, and creating it again solved it.
FWIW, I was able to fix it by just deleting the interpreter and recreating it. I did not have to restart or invalidate caches.
If you don't want to restart, you can also just hit edit, then hit "OK" and it seems to refresh at that point.
But would love a better method for this.
I'm having this same issue. I've been forcing a refresh via Chris' method, but it seems a bit clunky. Is there a better way?
1. Close PyCharm
2. Remove directory PyCharmXXXX.X/remote_sources
3. Remove directory PyCharmXXXX.X/python_stubs
4. Open PyCharm
Same problem for docker-compose based interpreters.
Here is my workaround:
Settings > Project Interpreter: click gear icon > More
click edit icon
OK, OK, OK
:)
@jetbrains: The Project Interpreter view desperately needs a refresh button.
Yes, please add the ability to manually refresh the indexes of External Libraries.
This would be such a productivity boost! Please add a feature to refresh the libraries.
This is causing me major hassles every time I modify shared packages on my vagrant box. I'm finding that even a full restart/clear caches often doesn't work so I end up resorting to deleting remote_sources and python_stubs. This needs serious attention JetBrains!
Hello,
Have you tried to use "Reload List of Paths": https://www.jetbrains.com/help/pycharm/project-interpreters.html ?
Hello Yaroslav,
Don't work, unfortunately. Looking the age of comments, its seems a old bug in Intelij linux versions.
Hi. I'm running into a similar issue. We are a team of about 10 people. In order to consolidate config files, I created some basic setups, incl. a template jdk.table.xml (see attachment) so that nobody has to worry about an incomplete interpreters list. However, I removed all paths and indexes from the file because these paths may be different on every workstation. Manually reloading (Reload list of paths) would do the job (appends the paths to the jdk.table.xml file) but it's a pain to do that for 30 different interpreters (and this is only a draft) for every user in our team. Is it possible to reload the paths of all registered interpreters in one go? Can you suggest a better workflow?
btw. I'm using build PY-181.5087.37
I also just figured that reloading the paths does not have an effect without actually changing the interpreter. If the interpreter is not changed, the OK button won't change to enabled, so therefore, the reloaded paths won't be saved. Bug or feature?
Following Yaroslov's recommendation worked for me for new packages that were added to my remote env. Not sure if existing packages were updated it would have worked.
I am developing a module and using that module for another project in parallel. It is cumbersome to purge the cache of the module each time I update it. Hope this process can be automatic or at least single-click.
I have the same issue.
This trick (as mentioned above) worked for me:
Remove directory PyCharmXXXX.X/remote_sources
But it corrupted my Project Interpreter.
It's pretty frustrating to find bugs in PyCharm only to find tickets for them that have been opened for 5+ years. This happens quite often.
Found the solution.
Go to External Libraries in the project tree and expand it.
Right click on "Remote Libraries", you will see an option to "Synchornize '<number>'",
this will refresh all the external libraries.
Thank you so much @Bityon!!!
I've had email alerts setup on this thread for *years*. Finally, a solution! :-D
Unfortunately, using the 'Synchronize' option does not work for me. Only deleting the skeletons locally and reopening the project works. Not a big deal though.
Just to let everybody know, in case you run into the same issue. It works fine for me.
I have PyCharm (2018.3) installed in my local host computer.
And I use a remote host (a Virtual Box VM) as my development environment.
On the remote host (the Virtual Box VM), I use "pipenv". Thus I will use the expression "remote environment" to refer to the virtual environment (virtualenv) on the remote host.
PyCharm has no problem finding the packages installed on the "remote environment".
I wrote a note that shows how I configured PyCharm.
https://github.com/denis-beurive/python-notes/blob/master/pipenv.md#pipenv-on-a-remote-host-with-pycharm-20183
Regards.
solved for me by :
File ---- Invalidate Caches/ Restart ----- Invalidate and Restart
5 years later and I am experiencing the same problem. I am using WSL to hold my "remote libraries". Synchronising like @Bityon is not working for me - the other methods are a bit cumbersome.
@João Abrantes
Have you tried invalidating cache / restarting, and then using the synchronize?