Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2015.3/PTVS Python Tools no longer working?

strong textI reinstalled VS 2015 Update 3 (from Web install) w/Python Tools, but Python Tools don't seem to work anymore. From ActivityLog.xml, the error is:

<record>494</record>
<time>2016/07/04 15:59:16.031</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Python Tools
             Package]Source:
&apos;Microsoft.VisualStudio.Composition&apos; 
Description: Expected 1 export(s) with contract name
&quot;Microsoft.PythonTools.Interpreter.IInterpreterOptionsService&quot;
but found 0 after applying applicable constraints.
#x000D;&#x000A;
Microsoft.VisualStudio.Composition.CompositionFailedException: 
Expected 1 export(s) with contract name 
&quot;Microsoft.PythonTools.Interpreter.IInterpreterOptionsService&quot; 
but found 0 after applying applicable constraints.&#x000D;&#x000A;   
Microsoft.VisualStudio.Composition.ExportProvider.GetExports
(ImportDefinition importDefinition)&#x000D;&#x000A;   at 
Microsoft.VisualStudio.Composition.ExportProvider.GetExports
[T,TMetadataView](String contractName, ImportCardinality 
cardinality)&#x000D;&#x000A;   at    
Microsoft.VisualStudio.Composition.ExportProvider.GetExport
[T,TMetadataView]       (String contractName)&#x000D;&#x000A;   at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]
(String   contractName)&#x000D;&#x000A;   at    
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]
()&#x000D;&#x000A;   at   
Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue
[T]  ()&#x000D;&#x000A;   at 
Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService
[T]  ()&#x000D;&#x000A;   at
Microsoft.PythonTools.PythonToolsService..ctor(IServiceContainer
container)&#x000D;&#x000A;   at   
Microsoft.PythonTools.PythonToolsPackage.Initialize()&#x000D;&#x000A;
at  
Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.
Interop.IVs    Package.SetSite(IServiceProvider sp)</description>
<guid>{6DBD7C1E-1F1B-496D-AC7C-C55DAE66C783}</guid>
<hr>80131500</hr> <errorinfo></errorinfo>

I de-installed/re-installed VS 2015 Python support (directly from PTVS 2.2.4 VS 2015.msi). Same error.


What to do? The Machine (Win 10) has Python 2.7/x64 in PATH.

There seems to be a real problem for other too. See here: Visual Studio Python Environments window does not display

Interestingly, I have two similar dev machines (Win10/x64), both installed recently, both have VS 2013Pro + VS2015 Community installed. On one box, everything works fine, on the other: see above.

like image 588
rubber boots Avatar asked Dec 05 '22 17:12

rubber boots


1 Answers

Had the same issue. Visual Studio 2015 Update 3, PTVS 2.2.4

Resolved it by:

  1. Closing VS
  2. Clearing the content of C:\Users\YOUR_USERNAME\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache folder. * notice the YOUR_USERNAME and replace it with your actual username to get the local path.
  3. Relaunching VS.

Hope this helps

like image 191
vvvlad Avatar answered Dec 23 '22 06:12

vvvlad