question

JohnZhang-1344 avatar image
0 Votes"
JohnZhang-1344 asked TianyuSun-MSFT commented

Visual Studio 2022 Crashes

Dear Support,


I noticed the differences between 'Command Prompt' & Powershell to install/list python packges but not be able to understand the reason hebind it. Most importantly, not sure how to make the installed py package availble to my Visual Studio py project

Powershell was used to install pyodbc successfully and it is proved by pip3 show pyodbc
PS C:\Users\johnz\AppData\Local\Programs\Python\Python37> pip3 show pyodbc
Name: pyodbc
Version: 4.0.32

However, under command prompt
C:\Users\johnz\AppData\Local\Programs\Python\Python37>pip3 show pyodbc
WARNING: Package(s) not found: pyodbc

Therefore pyodbc is not available in my VS py project

VS 2022 CRACHES when View All Python Environments is clicked
202845-image.png



Please advise ...

Thanks,
John

windows-server-powershellvs-general
image.png (16.5 KiB)
· 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.

Hi @JohnZhang-1344 , welcome to Microsoft Q&A forum. It should work, CMD may not find the pip3.exe, I am not sure if you have set the Environment variable well for it. You can try to use following command to let CMD recognize the pip3.exe => C:\Users\[username]\AppData\Local\Programs\Python\Python37\Scripts\pip3.exe show pyodbc. Besides, have you selected the Add Python X.X to PATH option when you were installing Python?

203115-image.png

0 Votes 0 ·
image.png (90.5 KiB)

1 Answer

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered

PowerShell and CMD are two different shells.

Check the environment variables while running both of them. Is there a difference? What about your pip.conf file? Does it contain all the necessary information you need to function in a CMD shell?

How was PowerShell used to install Python packages? Did it merely run the DOS commands (i.e. the same commands that you would have run if you installed from the CMD shell)?

I think you should add the necessary tags to include the Visual Studio and maybe the Python SMEs.

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.