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
Conda environment folders are not recognized as virtual environments #5191
Comments
More details, the virtual environment is on a file share in a linux environment. |
As a workaround you can disable the warning for now like so: "python.analysis.diagnosticSeverityOverrides": {
"reportShadowedImports": "none"
} |
I can reproduce this in a conda enviroment if I open the 'envs' folder: We don't detect conda environments as virtual environments because they don't have a We could probably detect this situation, but I don't think this is very common. Most of the time the env folder is tucked away under the home directory. |
I do know there are also up-and-coming tools like Pixi that prefer to put Conda envs in a project subfolder, so it may become more common in the future. Pixi stores things in For anyone else who likes to put Conda envs in a .gitignored subfolder of their projects (like me!), Pylance will happily ignore it as long as you name your subfolder something like |
This issue has been fixed in prerelease version 2024.4.100, which we've just released. You can find the changelog here: CHANGELOG.md |
Discussed in #5143
Originally posted by Ritesh313 November 24, 2023
I'm getting
"<module_name>"is not accessed
warnings from Pylance in my python file while importing all the stdlib modules.The warning description just says:
conda_env_location/lib/python3.9/<module_name>.py" is overriding the stdlib module "<module_name>"
I have my anaconda environment selected as my interpreter in VS code. I know it's just a warning and not interrupting my code, but I would just like to know if I have something setup wrong. Please let me know if I should provide some other information for this.
Modules which have this warning: datetime, random, typing, argparse
Platform: VS code
Environment: Conda
Python version: 3.9.7
Here's a screenshot of the warning:
The text was updated successfully, but these errors were encountered: