--- a/src/eric7/VirtualEnv/VirtualenvManager.py Tue Oct 18 16:24:57 2022 +0200 +++ b/src/eric7/VirtualEnv/VirtualenvManager.py Tue Oct 18 16:33:23 2022 +0200 @@ -104,22 +104,24 @@ # check, if the interpreter used to run eric is in the environments defaultPy = Globals.getPythonExecutable() - found = False - for venvName in self.__virtualEnvironments: - if defaultPy == self.__virtualEnvironments[venvName]["interpreter"]: - found = True - break - if not found: - # add an environment entry for the default interpreter - self.__virtualEnvironments[VirtualenvManager.DefaultKey] = { - "path": "", - "interpreter": defaultPy, - "variant": 3, - "is_global": True, - "is_conda": False, - "is_remote": False, - "exec_path": "", - } + if "{0}.venv{0}".format(os.sep) not in defaultPy: + # only check for a non-embedded environment + found = False + for venvName in self.__virtualEnvironments: + if defaultPy == self.__virtualEnvironments[venvName]["interpreter"]: + found = True + break + if not found: + # add an environment entry for the default interpreter + self.__virtualEnvironments[VirtualenvManager.DefaultKey] = { + "path": "", + "interpreter": defaultPy, + "variant": 3, + "is_global": True, + "is_conda": False, + "is_remote": False, + "exec_path": "", + } self.__saveSettings()