PTVS
PTVS copied to clipboard
An error was reported in the output window when creating the env.
Describe the bug
Steps to Reproduce
- Create a Python Application.
- Create a virtual environment.
Expected behavior
The output window shows that the virtual environment was created successfully.
Additional context and screenshots
An error was reported in the output window when creating the env.
@ttspace I think this is an issue with the VS installer not cleaning up registry keys properly. We've seen things like this in the past.
Can you verify that the following folder exists on your machine? C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64
This is where VS installs python.
If python isn't there, there might be stale registry keys that VS uses to check for existing installations. To fix the registry, do the following:
- Run Start -> regedit
- Delete
Computer\HKEY_CURRENT_USER\Software\Python
(this will mess up any other python installs you have) - Delete
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Python
(this will mess up any other python installs you have) - Run VS again and modify your installation. Python 3.9 should now be unchecked. Check it and click on Modify and it will be installed.
- Now verify that the following registry entry exists:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.9
- Verify that the installed python is actually on disk at
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64
I did these steps and I was able to run python applications using the python that comes with VS.
@AdamYoblick I didn't do anything else, python is here.
-
Computer\HKEY_CURRENT_USER\Software\Python
does not exist. -
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.9
It exists.
I don't see the exact same error message from pylance, but I AM able to repro the Python was not found
messages, even though the environment is able to be created successfully. Let me investigate.
In today's latest build:17.6.0 Preview 2.0 [33407.118.main],Python Package:17.0.23033.1
output_info
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
AssignProcessToJobObject: (87) The parameter is incorrect.
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Virtual environment is being created at 'C:\Users\wangjun\source\repos\PythonApplication4\PythonApplication4\env'
Error: Unknown change event received
at e.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:92:23)
at Object.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:181:22)
at t.SourceFile.setClientVersion (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\sourceFile.ts:676:49)
at L.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\program.ts:361:35)
at _0x4635b7.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\backgroundAnalysisProgram.ts:101:23)
at C.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\service.ts:310:41)
at _0x45764f.onDidOpenTextDocument (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\languageServerBase.ts:1247:35)
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Error: Unknown change event received
at e.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:92:23)
at Object.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:181:22)
at t.SourceFile.setClientVersion (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\sourceFile.ts:676:49)
at L.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\program.ts:361:35)
at _0x4635b7.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\backgroundAnalysisProgram.ts:101:23)
at C.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\service.ts:310:41)
at _0x45764f.onDidOpenTextDocument (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\languageServerBase.ts:1247:35)
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Error: Unknown change event received
at e.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:92:23)
at Object.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:181:22)
at t.SourceFile.setClientVersion (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\sourceFile.ts:676:49)
at L.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\program.ts:361:35)
at _0x4635b7.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\backgroundAnalysisProgram.ts:101:23)
at C.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\service.ts:310:41)
at _0x45764f.onDidOpenTextDocument (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\languageServerBase.ts:1247:35)
at runNextTicks (node:internal/process/task_queues:61:5)
at processImmediate (node:internal/timers:437:9)
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Error: Unknown change event received
at e.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:92:23)
at Object.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:181:22)
at t.SourceFile.setClientVersion (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\sourceFile.ts:676:49)
at L.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\program.ts:361:35)
at _0x4635b7.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\backgroundAnalysisProgram.ts:101:23)
at C.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\service.ts:310:41)
at _0x45764f.onDidOpenTextDocument (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\languageServerBase.ts:1247:35)
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Error: Unknown change event received
at e.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:92:23)
at Object.update (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver-textdocument\lib\esm\main.js:181:22)
at t.SourceFile.setClientVersion (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\sourceFile.ts:676:49)
at L.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\program.ts:361:35)
at _0x4635b7.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\backgroundAnalysisProgram.ts:101:23)
at C.setFileOpened (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\analyzer\service.ts:310:41)
at _0x45764f.onDidOpenTextDocument (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\src\languageServerBase.ts:1247:35)
Virtual environment was successfully created at 'C:\Users\wangjun\source\repos\PythonApplication4\PythonApplication4\env'
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
@StellaHuang95 can you try to repro this whenever you have some time? I just want to make sure this isn't an urgent blocker now. Thanks :)
@AdamYoblick I saw a bunch of Error: Unknown change event received
, but I wasn't able to repro the Python was not found
messages
Does the environment still get created? Unknown event received seems like a pylance issue, we probably need to present this to the team then.
@AdamYoblick yes
Ok great, doesn't seem too urgent then. The error messages are annoying and we need to fix them. But the callstack concerns me, that's a pylance problem. Either there's a bug in pylance, or PTVS is sending something it shouldn't be. Needs more investigation.
In today's latest build, the output window shows this error:
AssignProcessToJobObject: (87) The parameter is incorrect.
In today's build:17.6.0 Preview 3.0 [33606.364.d17.6], Python Package:17.0.23087.1 After create an env, File -> New Project; output window shows this error:
Python was not found but can be installed from the Microsoft Store: ms-windows-store://pdp/?productid=9NJ46SX7X90PSending log message failed
Sending log message failed
Sending log message failed
Sending log message failed
Sending log message failed
Error: Connection is closed.
at throwIfClosedOrDisposed (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:829:19)
at Object.sendNotification (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-jsonrpc\lib\common\connection.js:910:13)
at p.send (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver\lib\common\server.js:99:33)
at p.log (c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver\lib\common\server.js:95:14)
at c:\program files\microsoft visual studio\2022\preview\common7\ide\extensions\microsoft\python\core\pylance\dist\pyright-internal\node_modules\vscode-languageserver\lib\common\server.js:374:37
at processTicksAndRejections (node:internal/process/task_queues:96:5)
On today's latest build, there is an error after creating a conda-environment
----- Creating 'conda01' -----
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
==> WARNING: A newer version of conda exists. <==
current version: 23.7.2
latest version: 23.7.3
Please update conda by running
$ conda update -n base -c defaults conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.7.3
Downloading and Extracting Packages
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use
#
# $ conda activate conda01
#
# To deactivate an active environment, use
#
# $ conda deactivate
----- Successfully created 'conda01' -----
AssignProcessToJobObject: (87) The parameter is incorrect.
pylance crash related to textDocument.text missing was here. https://github.com/microsoft/PTVS/pull/7401