Skip to content
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

[BUG] Doesn't see "Visual editor" option when open flow.dag.yaml in VSCode #358

Closed
Vivihung opened this issue Sep 9, 2023 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Vivihung
Copy link
Member

Vivihung commented Sep 9, 2023

Describe the bug
According to the documentation, there should be a "Visual editor" option when open flow.dag.yaml file in VSCode. However, I didn't see "Visual editor" in my VSCode.

How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:

  1. Follow this documentation to create an init flow via pf.
  2. Once the project is created, open the flow.dag.yaml file in VSCode.
  3. Didn't see any "Visual editor" option in the editor.

Expected behavior
See "Visual editor" on the top-left corner of the file editor.

Screenshots
image

Running Information(please complete the following information):

  • Promptflow Package Version using pf -v: 0.1.0b5
  • Operating System: Windows 11
  • Python Version using python --version: Python 3.11.4
  • VSCode version: 1.82.0

Additional context
Wonder if it's virtual env related.

  • Prompt flow VSCode extension is installed.
  • I use a virtual environment with VSCode workspace. promptflow and promptflow-tools are installed in the virtual env.
  • I can see the Prompt flow VSCode extension complains about missing promptflow and promptflow-tools. Maybe the extension does not support virtual env?!
    image
@Vivihung Vivihung added the bug Something isn't working label Sep 9, 2023
@ttthree
Copy link
Member

ttthree commented Sep 9, 2023

@Vivihung can you share the full screen of the "Install dependencies" page?
I've tried virtual env and it worked for me so far.

CleanShot 2023-09-09 at 17 46 49@2x

@henry-zeng
Copy link

@Vivihung if you just update the promptflow SDK, you may need to reload your VSCode window, and then check the install dependecy again to see whether you venv can pickup the latest library, and then you cango to flow.dag.yaml to select the venv you have pf installed, which you should be able to see the visual editor

@Vivihung
Copy link
Member Author

Thanks for your suggestions. I can see the visual editor on one of my machine (not the repro one though). Will spend a bit more time with the repro machine and share findings here.

@Vivihung
Copy link
Member Author

Update on my investigation - The problem seems related to the VSCode Python extension. The reason the PF dependencies don't get detected correctly is due to the Python interpreter wasn't set to the right virtual env, and cannot be updated.

An easy way to identify this issue is to open a python file in VSCode. If the Python interpreter in the VSCode status toolbar (in bottom of the VSCode window) shows warning even selecting the right env python from the command bar, then you hit this issue.

My way to resolve it is

  1. Uninstall all VSCode extensions that depends on the Python extension.
  2. Uninstall Python extension.
  3. Close VSCode.
  4. Clean up VSCode caches [ref].
  5. Reinstall VSCode Python extension and the Prompt flow extension.
  6. Open the code in VSCode.

@JYC-99 JYC-99 self-assigned this Sep 19, 2023
@JYC-99 JYC-99 closed this as completed Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants