diff --git a/src/tribler-gui/tribler_gui/core_manager.py b/src/tribler-gui/tribler_gui/core_manager.py index 18cf95bfc37..daea50af2ab 100644 --- a/src/tribler-gui/tribler_gui/core_manager.py +++ b/src/tribler-gui/tribler_gui/core_manager.py @@ -92,7 +92,11 @@ def start_tribler_core(self): core_args = self.core_args if not core_args: - core_args = sys.argv + ['--core'] + # If the core is running on frozen environment, sys.argv[0] becomes tribler executable while + # running from source code, sys.argv[0] is run_tribler.py which is run by python runtime. + # So, we skip the first argument to prevent argument parsing error on frozen environment. + sys_argv = sys.argv if not hasattr(sys, '_MEIPASS') else sys.argv[1:] if len(sys.argv) > 1 else [] + core_args = sys_argv + ['--core'] self.core_process = QProcess() self.core_process.setProcessEnvironment(core_env)