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

Feature Request: Create New Folder w/ venv #1441

Closed
Tracked by #2110
jthomasmock opened this issue Sep 28, 2023 · 11 comments
Closed
Tracked by #2110

Feature Request: Create New Folder w/ venv #1441

jthomasmock opened this issue Sep 28, 2023 · 11 comments
Labels
area: project wizard Issues related to New Project Wizard category.

Comments

@jthomasmock
Copy link
Contributor

Positron Version:

Steps to reproduce the issue:

As someone who largely uses virtual environments, I frequently hit the "Python support requires module ipykernel. Install?" each time I open up a new project/folder.

The VS Code Python extension has a built in way to create environments via Venv or Conda: https://code.visualstudio.com/docs/python/environments#_creating-environments

This helps with hooking up all the plumbing so that VSCode/Positron gets users into a good starting state of the virtual environment is created, recognized, and respected.

In Positron, it might be nice to build on that concept and support creating a folder with some predefined R/Py structure:

  • Pre-select a version of R/Python
  • Option to use Venv/Conda with Python or renv with R, and maybe indicate that IPykernel will be pre-installed into virtual environment?
  • Don't have to use a .RProj or some other project dotfile, but initialize the virtual environment, preferably pre-install IPykernel (and tell the user this has happened) and preferably create a minimal .gitignore that ignores the virtual environment folder.

What did you expect to happen?

Were there any error messages in the output or Developer Tools console?

@jthomasmock
Copy link
Contributor Author

Also related to: #1371

@jthomasmock
Copy link
Contributor Author

There's also some interesting discussion from the python-extension folks at: microsoft/vscode-python#19314

@juliasilge
Copy link
Contributor

In our Python OSS sync meeting this week, the following list of jobs/tasks was put together about what folks want to do when they are creating a new workspace:

  • New project
  • With a virtual environment named .venv
  • That already contains IPykernel
  • With a gitignore for .venv
  • With the selected interpreter set as the .venv

This should happen before even opening the folder, so the experience feels very seamless.

@jthomasmock
Copy link
Contributor Author

Wow, looks great! Minor nit, but probably default to check for Install ipykernel, since it's essentially required for a fresh environment?

Possibly out of scope...
but do you want to include an option for a "Project type" in the future or is that out of scope for now?

@seeM
Copy link
Contributor

seeM commented Oct 24, 2023

Agreed on the ipykernel checkbox default. It's a bit of a weird one because you can't actually use the environment in Positron without ipykernel installed so maybe a checkbox isn't the right component. At the same time, we don't want to install something into a user's environment without their permission. Maybe a checkbox with a note?

I've personally been focused on how we integrate Python environment management into New Folder. I think "project type" is important, but not sure if we tackle that at the same time or later – perhaps @petetronic can comment?

@petetronic
Copy link
Collaborator

I think project type will be an earlier question.

Thanks for pushing this along @seeM, maybe we could rearrange the order of questions such that you pick an interpreter first, and then if that isn't already a venv etc., then offer the section to create one as a secondary consideration?

@juliasilge
Copy link
Contributor

We presented this UI mockup in the monthly Python OSS sync and folks were so excited about having good tooling around this! Here is some feedback:

  • Folks strongly want the ipykernel installation to be default "yes" so you would need to opt out of installing ipykernel if you really want that for some reason.
  • It is possible and in fact a good practice to start from an environment with a venv and make a new venv for a new project, i.e. the original environment is used as a template and copied but the original venv is not used. We'd like either starting from a base interpreter or a "previously configured" interpreter to then lead to making a new venv.
  • Being possible to skip making a new venv is acceptable but folks strongly want making a new venv for a new project opt-out. This is an area where being more opinionated could really help our users. We particularly talked about Posit customers on Workbench and how support in this area would be helpful.
  • Folks want the ability to have a template-like experience where they have, say, a default data analysis or ML requirements.txt and then can make new but separate projects from that template.
  • Pretty much everything in this screenshot can be confusing to new users. Can we add some nice tooltips / hotspots that users can click on to get more info, like a brief description of what a virtualenv is and is used for, same for interpreter, what is "location" in this context, etc.

@isabelizimm
Copy link
Contributor

Few thoughts:

  • If project type will be earlier, will it still be necessary to select a language (eg, if I choose "Python package")? I wonder if that could be eliminated 🤔
  • Would "Location" be automatically filled? Also, is this the location of a .venv file, or the path to the interpreter?

Overall, I like the look of this for a simple data science Python folder!

@jthomasmock
Copy link
Contributor Author

cc @sharon-wang

@jthomasmock
Copy link
Contributor Author

JupyterLab now has a "new environment" wizard, but is not necessarily tied to a new folder.

https://blog.jupyter.org/python-environment-management-in-jupyterlab-desktop-3b119c5811d9

@posit-dev posit-dev deleted a comment from seeM Jun 21, 2024
@posit-dev posit-dev deleted a comment from seeM Jun 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: project wizard Issues related to New Project Wizard category.
Projects
None yet
Development

No branches or pull requests

7 participants