1

Closed

Detect virtual environment fails if base interpreter is not installed

description

If you import an existing project that includes a virtual environment, but the base interpreter for that environment is not installed, you get the following error:
System.NullReferenceException: Object reference not set to an instance of an object. 
at Microsoft.PythonTools.Project.ImportWizard.ImportSettings.AddVirtualEnvironment(ProjectRootElement project, String sourcePath, InterpreterFactoryCreationOptions options) 
at Microsoft.PythonTools.Project.ImportWizard.ImportSettings.WriteProjectXml(IInterpreterOptionsService service, TextWriter writer, String projectPath, String sourcePath, String filters, String searchPaths, String startupFile, PythonInterpreterView selectedInterpreter, ProjectCustomization customization, Boolean detectVirtualEnv) 
at Microsoft.PythonTools.Project.ImportWizard.ImportSettings.<>c__DisplayClass19.<CreateRequestedProjectAsync>b__18() 
at System.Threading.Tasks.Task`1.InnerInvoke() 
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Microsoft.PythonTools.Project.ImportWizard.ImportSettings.<CreateRequestedProjectAsync>d__1b.MoveNext()
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at Microsoft.PythonTools.Commands.ImportWizardCommand.<CreateProjectAndHandleErrors>d__0.MoveNext()
Closed Mar 20 at 8:21 PM by Zooba

comments