diff -r 680150fd2b8c -r 083ae2a3cd3b src/eric7/EricWidgets/EricPathPicker.py --- a/src/eric7/EricWidgets/EricPathPicker.py Sat Sep 28 17:47:10 2024 +0200 +++ b/src/eric7/EricWidgets/EricPathPicker.py Sat Sep 28 19:56:41 2024 +0200 @@ -22,8 +22,15 @@ ) from eric7.EricGui import EricPixmapCache -from eric7.RemoteServerInterface import EricServerFileDialog -from eric7.SystemUtilities import FileSystemUtilities + +try: + # These are only available if used with eric-ide + # (https://eric-ide.python-projects.org) + from eric7.RemoteServerInterface import EricServerFileDialog + from eric7.SystemUtilities import FileSystemUtilities + HAS_REMOTE_SERVER_SUPPORT = True +except ImportError: + HAS_REMOTE_SERVER_SUPPORT = False from . import EricFileDialog from .EricApplication import ericApp @@ -198,8 +205,8 @@ @param remote flag indicating the remote mode @type bool """ - self.__remote = remote - if remote: + self.__remote = remote and HAS_REMOTE_SERVER_SUPPORT + if self.__remote: self.__remotefsInterface = ( ericApp().getObject("EricServer").getServiceInterface("FileSystem") ) @@ -910,8 +917,9 @@ @rtype list of str """ paths = [] - for index in range(self._editor.count()): - paths.append( - FileSystemUtilities.remoteFileName(self._editor.itemText(index)) - ) + if HAS_REMOTE_SERVER_SUPPORT: + for index in range(self._editor.count()): + paths.append( + FileSystemUtilities.remoteFileName(self._editor.itemText(index)) + ) return paths