question

Murtaza-8107 avatar image
1 Vote"
Murtaza-8107 asked PabloIsaiNunezIsais-6418 edited

Visual Studio 2017 Crashes when trying to open Python Environment window from Tools

I am already using Anaconda Navigator which uses Python 3.8 (it is working fine).

I tried installing Python from Visual Studio Installer and after installation I tried to open Python Environment window from Tools.
The program just crashes and Visual Studio is closed.

Is there a clash of Python Path somewhere (between Anaconda Navigator and Visual Studio)?

Also, if I try to open a Python project in Visual Studio, I get the following message

87391-2021-04-13-11-44-45-start-page-microsoft-visual-st.png

It shows Unsupported Python Version 3.8.


vs-generaldotnet-standard
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Did you also consider another environment: Visual Studio Code — https://code.visualstudio.com/docs/languages/python?

0 Votes 0 ·
PabloIsaiNunezIsais-6418 avatar image
0 Votes"
PabloIsaiNunezIsais-6418 answered PabloIsaiNunezIsais-6418 edited

Hi, I have a possible solution for you, I have been working in Anaconda3 with Spyder in Python 3.8.5 version. When I try to open the Environments window in Visual Studio 2017 (Tools -> Python -> Python Environments) my Visual just crash and restart. My solution was to modify the Visual Studio Installer and only select the Python 3 for 64-bit and 32-bit. 126426-image.png


Then in the Visual Studio app go to (Tools -> Python -> Diagnostic info..) and in the Experimental window uncheck Automatically detect Conda Environments and Use Conda package manager ... 126388-image.png



Finally, try to open again the Python environments and prove to select different packages in the visual studio installer for Python at your convenience. I hope to be useful for you.


image.png (137.7 KiB)
image.png (41.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Murtaza-8107 avatar image
0 Votes"
Murtaza-8107 answered TianyuSun-MSFT commented

Thank You for the reply! However, as I mentioned, I am fully aware that Visual Studio 2017 does not support Python 3.8. But I also have Conda Environments for Python 3.7 and 3.6 (installed using Anaconda Navigator). Visual Studio does detect these environments as shown here,


88127-image.png




But then, it shows only this and then Visual Studio crashes. I can't work anymore!
I don't understand what seems to be the problem.


image.png (17.4 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Murtaza-8107 , thanks for your feedback. Is py38(XX,XX) Conda Environment detected in the Python Environments window and shown in boldface maybe? Please check this document: Manage Python environment and this document: How to select a Python environment for a project to see if this works.

0 Votes 0 ·

Hello, thank you for the information. But like I mentioned

when I select Tools -> Python -> Python Environments (or) View -> Other Windows -> Python Environments, Visual Studio just crashes and I cannot proceed any further.

I am using Visual Studio 2017 (15.9.34)

0 Votes 0 ·

I suppose that by default, Visual Studio is detecting the Python 3.8 version in my system and that's the reason it gets crashed. How can I change this default Python path to 3.7 without making it crash?

0 Votes 0 ·

Hello @Murtaza-8107, perhaps you can try to change the register key to set the default path for Python. Please remember to back up the register key before you change it.

0 Votes 0 ·
TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered

Hello @Murtaza-8107 ,

Welcome to Microsoft Q&A forum.

As the prompt window mentioned, Visual Studio 2017 doesn’t support Python 3.8 currently.

Please kindly check this two screenshots to see the supported Python version for Visual Studio 2017 and Visual Studio 2019:

88087-image.png

88154-image.png

Besides, please also kindly check this thread: No Official Python 3.8 Support for Visual Studio 16.4.

Best Regards,
Tianyu


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (64.6 KiB)
image.png (78.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.