2

Closed

"Unable to determine Python Tools installation path" while creating new Python empty module

description

After I've installed PTVS (PTVS 2.0 RC VS 2010.msi from http://pytools.codeplex.com/downloads/get/725054) I try to create new file:
File - New - File... - Python Editor - Empty Module - Open
And Visual Studio crashes after that.
System.InvalidOperationException: Unable to determine Python Tools installation path
   at Microsoft.PythonTools.PythonToolsInstallPath.GetFile(String filename)
   at Microsoft.PythonTools.Interpreter.PythonTypeDatabase.get_BaselineDatabasePath()
   at Microsoft.PythonTools.Interpreter.PythonInterpreterFactoryWithDatabase.MakeTypeDatabase(String databasePath, Boolean includeSitePackages)
   at Microsoft.PythonTools.Interpreter.PythonInterpreterFactoryWithDatabase.CreateInterpreter()
   at Microsoft.PythonTools.PythonToolsPackage.CreateAnalyzer()
   at Microsoft.PythonTools.Extensions.GetAnalyzer(ITextBuffer buffer)
   at Microsoft.PythonTools.Extensions.GetAnalyzer(ITextView textView)
   at Microsoft.PythonTools.Intellisense.IntellisenseControllerProvider.TryCreateIntellisenseController(ITextView textView, IList`1 subjectBuffers)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.IntellisenseManagerConnectionListener.<>c__DisplayClass5.<SubjectBuffersConnected>b__1(IIntellisenseControllerProvider provider)
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)

file attachments

Closed Dec 16, 2013 at 4:52 AM by Zooba

comments

Zooba wrote Sep 11, 2013 at 3:22 PM

This sounds like you may have a corrupt installation. Can you check the output from the following commands (run at a cmd.exe prompt):
reg query hklm\Software\Microsoft\PythonTools\10.0 /v InstallDir /reg:32
Should show:
HKEY_LOCAL_MACHINE\Software\Microsoft\PythonTools\10.0
    InstallDir    REG_SZ    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\
And:
dir /b "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\CompletionDB\__builtin__.idb"
Should show:
__builtin__.idb
Also, did you upgrade from a previous version? And do you have any other versions of VS or PTVS installed?

sarthakmahapatra wrote Dec 2, 2013 at 4:06 AM

I am facing the same issue. I have VS 2013 and VS 2010. PY tools for both are giving the same issue.
Also, When i execute

dir /b "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\CompletionDB__builtin__.idb"

I do not get anything. There is no CompletionDB folder

Zooba wrote Dec 2, 2013 at 7:04 AM

What does the reg query command show? It should let us know if your installation didn't work properly.

sarthakmahapatra wrote Dec 2, 2013 at 8:22 AM

it gives the location where the py tools are installed. my VS 2013 is installed in D drive, therefore i get

D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0

And VS 2010 is installed in C:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0

Under Python Tools for Visual Studio\2.0 folder i have:
  1. Extensions\
  2. ItemTemplates\
  3. ProjectTemplates\
  4. License.html

Zooba wrote Dec 2, 2013 at 3:45 PM

It looks like you have the same problem discussed in this thread. Have a look at the marked answer and see if that helps.

sarthakmahapatra wrote Dec 6, 2013 at 3:49 AM

Awesome. this worked. thanks for your help.