virtualenv created in hidden directory (.venv/) is not automatically detected
See original GitHub issueIssue Type: Bug
Behaviour
Expected vs. Actual
When a new virtualenv was created in the terminal, vscode used to popup a prompt to select it as the python interpreter
Steps to reproduce:
- Open a terminal within vscode
python -m venv .venv
No popup.
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.9.7
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Pyenv
- Value of the
python.languageServer
setting: Pylance
User Settings
defaultLS: {"defaultLSType":"Pylance"}
downloadLanguageServer: true
envFile: "<placeholder>"
venvPath: "<placeholder>"
venvFolders: "<placeholder>"
condaPath: "<placeholder>"
pipenvPath: "<placeholder>"
poetryPath: "<placeholder>"
languageServer: "Pylance"
linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: true
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"
sortImports
• args: "<placeholder>"
• path: "<placeholder>"
formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "autopep8"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"
testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true
terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"
experiments
• enabled: true
• optInto: ["pythonDiscoveryModule"]
• optOutFrom: []
insidersChannel: "off"
tensorBoard
• logDirectory: "<placeholder>"
Extension version: 2022.0.1786462952 VS Code version: Code 1.64.0 (5554b12acf27056905806867f251c859323ff7e9, 2022-02-03T04:20:17.224Z) OS version: Darwin x64 21.3.0 Restricted Mode: No
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i7-9750H CPU @ 2.60GHz (12 x 2600) |
GPU Status | 2d_canvas: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled webgl: enabled webgl2: enabled |
Load (avg) | 7, 7, 7 |
Memory (System) | 16.00GB (0.03GB free) |
Process Argv | –crash-reporter-id e58e3d2a-e26d-42be-b0a2-cfd7504cefbc |
Screen Reader | no |
VM | 0% |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30425749
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30433059
pythonvs932:30410667
wslgetstartedc:30426334
vscop453:30404998
vsrem710cf:30416617
Issue Analytics
- State:
- Created 2 years ago
- Comments:17
Top Results From Across the Web
Visual Studio Code does not detect Virtual Environments
Activate your virtualenv. Go to the parent folder where your Virtual Environment is located and run venv\scripts\activate .
Read more >Pycharm Terminal fails to activate virtual env
When I click Terminal, it does not activate the virtualenv environment. How to recreate: I create a new project, selecting the option to......
Read more >Trying to come up with a default directory name for virtual ...
E.g. `python -m venv .venv` would have `.venv` as the directory ... It's hidden by default as it's almost an implementation detail and...
Read more >Python Virtual Environments: A Primer
Decide Where to Create Your Environment Folders; Treat Them as Disposables ... (venv) PS> python -m pip install <package-name>.
Read more >Python Tools for Managing Virtual Environments
To create a virtual environment in the directory .venv , try the following: ... The virtualenv tool is very similar to python -m...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@karrtikr ah good catch, that was it! I have
If I remove that, the virtualenv is found.
The reason I added the exclude was when I connect to a remote Linux instance I was getting errors about indexing taking too long. I guess what would be ideal is detection of
.venv
being created, but not watching of the individual files.Is it still worth me trying the new insiders version?
This is what I see when doing Python: Select Interpreter -> .venv