New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Python version is display wrong when use the latest python to create Conda environment. #6749
Comments
I'm able to repro this. When I try to get the python version from the minicondo environment, I get an error:
Maybe this has something to do with it. Need to dig into the environments window to see how we're getting the version number from the environment. |
The way it retrieves the version for non-root Conda environments is by printing out PTVS/Python/Product/VSInterpreters/Interpreter/CondaEnvironmentFactoryProvider.cs Line 346 in 114a3c8
PTVS/Python/Product/VSInterpreters/Interpreter/CPythonInterpreterFactoryProvider.cs Lines 166 to 181 in 114a3c8
So yes, this error would also break that. These types of errors from Conda usually indicate that it has been executed without activating it properly. Now, previously, I have only seen this when importing some module that had a native dependency - so you could still run It appears that, with Python 3.10, this is no longer the case, and the zlib dependency is directly from the DLL. So for 3.10+, |
@AdamYoblick |
I was able to repro this as well when selecting both python (latest) and python 3.10. I will investigate. |
I looked into this more and I found a way to get the python version from a conda environment without activating it, but it requires a few more steps.
This will output an array with a single element, which contains the python information, if the python package is installed. {
"base_url": "https://repo.anaconda.com/pkgs/main",
"build_number": 3,
"build_string": "h96c0403_3",
"channel": "pkgs/main",
"dist_name": "python-3.10.0-h96c0403_3",
"name": "python",
"platform": "win-64",
"version": "3.10.0"
}
|
@bschnurr Graham asked me to send the pylance issue your way, but this PR is broken right now because I pushed up code just to save my work, and it doesn't compile. Once I finish working on my p0 work, I'll get this PR in a healthy state, merge it in, then create separate issues for the debugger and pylance problems with 3.10 in conda and send you the pylance one 😄 |
sure thing. |
Yeah this is expected until the linked PR gets merged in. This is because we try to call into python.exe in the conda environment to determine the python version, and this call crashes because of a conda bug with 3.10. |
@bschnurr The commit that fixes this problem is in the |
Environment
Steps to Reproduce
Expected behavior
The environment is created successfully and display without aby error.
Additional context and screenshots
The Python version is display wrong when use the latest python to create Conda environment.
It displayed Python0.0, it should display Python 3.10
The text was updated successfully, but these errors were encountered: