Virtualenv / python settings are ignored
See original GitHub issueSummary
On my macOS I’m trying to keep things tidy. That is the reason why I installed virtualenv and virtualenvwrapper. Python is installed via brew.
There is some configuration in VSCode to select Python’s virtualenv in the settings.json:
"python.venvFolders": [
"~/.virtualenvs"
],
This works perfectly fine and the information (Python-version & selected virtualenv) is shown in the statusbar, but only if there’s some different filetype than Ansible is selected or the Ansible-extension is uninstalled or disabled.
With active Ansible-extension the virtualenv-Configuration is completely ignored and I get (of course) errors like these:
Ansible-lint is not available. Kindly check the path or disable validation using ansible-lint
This is my statusbar with any other file but “Ansible”:
This is my statusbar with a file of the type “Ansible”:
Additionally / of course none of the other interesting features of the Extension “Ansible” is working:
- autocompletion does not work
- linting does not work
Extension version
v1.0.90
VS Code version
1.72.2
Ansible Version
ansible --version
ansible [core 2.13.5]
config file = None
configured module search path = ['/Users/ppu/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /Users/ppu/.virtualenvs/ansible-runner/lib/python3.10/site-packages/ansible
ansible collection location = /Users/ppu/.ansible/collections:/usr/share/ansible/collections
executable location = /Users/ppu/.virtualenvs/ansible-runner/bin/ansible
python version = 3.10.8 (main, Oct 13 2022, 09:48:40) [Clang 14.0.0 (clang-1400.0.29.102)]
jinja version = 3.1.2
libyaml = True
OS / Environment
macOS 12.6, M1
ansible-lint --version
ansible-lint 6.8.2 using ansible 2.13.5
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (1 by maintainers)
So I’m now using
and it works:
I still have to say, I don’t like it that much, because I now have to use configuration pointing to distinct Python versions in VSCode.
@robinmalik I’d guess this issue is different than my initial issue since you’re apparently not using virtualenv but using Ansible in some container.
@yaegassy I still think the configuration with virtualenv and Python-Interpreter-Path could be more smooth, but I’d also be fine with closing this issue.