microsoft / vscode-azure-iot-edge

Azure IoT Edge for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-edge
Other
51 stars 36 forks source link

VS Code Python virtualenv where iotedgehubdev is installed is ignored #374

Closed angellmethod closed 4 years ago

angellmethod commented 5 years ago

Steps to Reproduce:

  1. Install iotedgehubdev in a virtualenv with the virtualenv referenced in .vscode/settings.json
  2. Activate virtualenv in VS Code from the command palette.
  3. Open a new terminal with the virtualenv activate.
  4. Try to right click on a device and run 'Setup IoT Edge Simulator' or try running the same command from the command palette.

Does this issue occur when all other extensions are disabled?: Yes

I have iotedgehubdev installed in a virtual environment in VS Code. The virtual environment is set in settings.json and I have it activated in VS Code and the terminal. When I try to run a command using the interface (Ex. right clicking on an Azure IoT Hub Device and selecting 'Setup IoT Edge Simulator'), one of two things happens: Either: 1) iotedgehubdev opens a new "Azure IoT Edge" terminal without using the activated environment. or: 2) I get a message that says 'You must have iotedgehubdev' tool installed for IoT Edge Simulator (but other commands like 'Start monitoring D2C message,' 'Get Device Info' works.

At least with (1) I can get the command I need, activate the environment myself and copy, paste, run the commands. It's not clear what causes this difference in behavior.

What I would expect is that my virtualenv is detected & activated if it's in the settings.json file before running the commands or I can at least get the commands in the terminal again and copy/paste.

adashen commented 5 years ago

@theangellmethod Thanks for reporting the issue. Currently iotedgehubdev is only searched under the environment from which VSCode is started. It is not aware of the python virtual environment. We will figure out a way to solve this issue. And keep you updated.

adashen commented 4 years ago

Version 1.19.0 integrate a standalone installation of iotedgehubdev on windows. So now there is no need to support python virtual env. @angellmethod Please let us know whether the new version solve your problem.

adashen commented 4 years ago

New version released for windows to integrate a standalone package. So the issue now is solved. So close it now.

angellmethod commented 4 years ago

I checked this yesterday and it seems like it worked fine for me. Thanks!