Reputation: 11
I have installed Win10, Visual Studio 2015, Python 2.7, Python 3.5 and PTVS 2.2.3.
Unfortunately PTVS does not work at all. I can not load any Python projects that were loading previously in Visual Studio. It worked before I installed Python 3.5. I tried to uninstall Python 2.7 and get an error saying that the uninstall didn't success. After several tries, the problem appears to be around pip which is somehow blocking both install and uninstall of Python 2.7.
When trying to open Python Tools from Tools menu, nothing happens. Neither window opens nor any error message is displayed. Python Environments window does not open even with the shortcut.
In Tools > Options > Python Tools, the only text shown is: "An error occurred loading this property page".
When I try to load/reload the Python project, the message is: "error : Expected 1 export(s) with contract name "Microsoft.PythonTools.Interpreter.IInterpreterOptionsService" but found 0 after applying applicable constraints." This has already been posted for 11 days ago, but no one has answered.
To solve this, I would like to know how to make the Python Environment window appearing in Visual Studio.
Thanks for any help.
Upvotes: 1
Views: 4738
Reputation: 638
VS keeps a cache of loaded assemblies that doesn't always get invalidated when it should.
If you delete C:\Users\You\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache and restart you should be fine. src: https://github.com/Microsoft/PTVS/issues/1388
Upvotes: 4
Reputation: 11
Thanks for your posts. My problem was fixed after I installed VS 2015 update 3 which included a new release of PTVS (June 2.2.40623).
Upvotes: 0
Reputation: 143
I`m also having similar issues, first installation path:
The issues started:
Not being able to reload my project after trying to debug the issue, I`ve decided to:
Now the issue was different, while trying to load my previous pyproj or even creating different Python projects using multiple templates. I was getting this error:
"There is a missing project subtype. Subtype: '{1b580a1a-fdb3-4b32-83e1-6407eb2722e6}' is unsupported by this installation."
Not finding anything around this, I`ve:
Now Visual Studio is crashing while trying to load the past mentioned pyproj, with the same error as OP:
SetSite failed for package [Python Tools Package][Expected 1 export(s) with contract name "Microsoft.PythonTools.Interpreter.IInterpreterOptionsService" but found 0 after applying applicable constraints.]
Still trying to fix it at the moment. Maybe these steps will help debugging the issue.
Update / Fixed
After installing VS 2015 with Update 1
and PTVS 2.2 for VS 2015
, I was still having issues opening the pyproj
causing VS to just crash (unfortunately nothing in ActivityLog.xml).
I've tried repairing Visual Studio through it's setup, still the same issue.
Finally, I've decided to re-update Visual Studio 2015 to Update 2
, causing also to update PTVS to March release
, all through VS setup utility.
And now my pyproj
correctly opens. Probably some versions miss match during the initial steps where I've installed a DEV version of PTVS. Not sure which step actually corrected my issue but it did.
Hope this will help somehow other people with similar issues.
Upvotes: 0
Reputation: 6486
You'll need to open the ActivityLog.xml (%APPDATA%\Microsoft\VisualStudio\14.0\ActivityLog.xml) and see if there's any exceptions there related to PTVS.
It sounds like you have a pretty messed up configuration at this point. You could try uninstalling PTVS and re-installing it, but my guess is your messed up Python installs are somehow throwing PTVS off and causing it to crash somewhere.
Upvotes: 0