Whinarn / vscode-python-auto-venv

Automatic selection of Python virtual environments in Visual Studio Code.
MIT License
9 stars 5 forks source link

Can you give a example about how to use this plugin? #15

Closed Arryboom closed 3 years ago

Arryboom commented 3 years ago

sorry to ask here,but I dont get it,is this plugin used for init venv automatically,or just setup the enviroment(which already inited with some command like python -m venv bob)

for example,I started a new py project in vscode,I want it support venv now I got a folder called exampleProject,and a file main.py in it,now I open main.py in vscode,will this plugin automatically init venv for me?Or when we in the main.py edit window I run ctrl+shift+p,input pythonautovenv.installVenv,will it do something like python -m venv bob,and then detect the libary imported from main.py and auto pip install them?

Whinarn commented 3 years ago

Hi @Arryboom,

This extension was only supposed to activate the virtual environments automatically, if it finds them, as well as install them if it finds files like Pipfile, requirements.txt etc. So you should still use whatever tool you use for dependency management on the side.

A side note is however that since this extension depends on having the official Python extension installed, and that extension is in process of changing fundamentals that breaks compatibility with this extension. As far as I know, the developers of the official Python extension has not yet introduced support for what's necessary for an extension like this one to work. Which would mean that this extension is on it's way to become deprecated and useless. But it's still possible to opt out of that experiment, but it's only a question of time for when they have fully released it. More information about that here: https://github.com/Whinarn/vscode-python-auto-venv/issues/11

In addition to this, I only use Python at my current workplace, and I am no longer working there after September, so I will likely archive this project as well, since I don't have any personal interest in continuing to develop things with Python. I will see if I can manage to move this repository to new ownership, otherwise it will be archived and deprecated.

So if you really need something like this, I strongly encourage you and anyone else to request the support of having multiple virtual environments within the same project in the official Python extension, because that would be a lot better than needing an additional extension like this one. You can find that repository here: https://github.com/microsoft/vscode-python

I hope that this both answers your questions as well as explain the future of this extension.

Arryboom commented 3 years ago

Sorry to hear that but Thanks anyway Man,I've thought this is a one-key venv manager style plugin from the official page in vscode plugin store's describe,and been installed and try so many 'my noob ways' to try figure out what can i do with this plugin,now your kind explain let me understand this perfectly,in my thinking vscode is also painful to coding c++ stuff,I may back to notepad++ with cmd console style lol,but still thanks for your costs to do this,believe this project used to help alot people in this world!