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?
51
63 comments
Did you ever find a solution to this? I am running into the same problem on PyCharm Professional 3.4.
1
Does the following not work? It doesn't for me, but I suspect that's some problem related to me having pycharm running on linux, having the remote interpreter being the windows version of python on a machine with openSSH on cygwin setup. If you're using the more common pycharm on windows, remote interpreter on linux (or windows?), the following will probably work:

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.
4

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....

 

4

Any update on this?

4

I'm having the exact same issue. Is there a way to resolve this?

2

The only way I was able to "resolve" the issue was to:

 

  1. Manually delete my remote Project Interpreter from Python.
  2. Manually add the Project Interpreter using pip to install any packages on my remote machine.
  3. Invalidate caches and restart.

 

0
Avatar
Permanently deleted user

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...

0
Avatar
Permanently deleted user

ok deleting the remote interpreter, restarting pycharm, and creating it again solved it.

1

FWIW, I was able to fix it by just deleting the interpreter and recreating it. I did not have to restart or invalidate caches.

2

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.

2
Avatar
Permanently deleted user

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?

0

1. Close PyCharm

2. Remove directory PyCharmXXXX.X/remote_sources

3. Remove directory PyCharmXXXX.X/python_stubs

4. Open PyCharm

4
Avatar
Permanently deleted user

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.

25

Yes, please add the ability to manually refresh the indexes of External Libraries. 

7

This would be such a productivity boost! Please add a feature to refresh the libraries.

7

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!

0
Avatar
Eduardo Marcondes

Hello Yaroslav,

Don't work, unfortunately. Looking the age of comments, its seems a old bug in Intelij linux versions.

0

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?

0

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?

0

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.

0

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.

1

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.

2

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. 

 

3

Thank you so much @Bityon!!!

 

I've had email alerts setup on this thread for *years*. Finally, a solution! :-D

2

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.

0

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.

 

 

0

solved for me by :

File ---- Invalidate Caches/ Restart  ----- Invalidate and Restart

3

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.

2

@João Abrantes

Have you tried invalidating cache / restarting, and then using the synchronize?

0

Please sign in to leave a comment.