positron icon indicating copy to clipboard operation
positron copied to clipboard

Enhanced Environments Management pane

Open kmasiello opened this issue 2 years ago • 11 comments

Building off of #1369.

Package and environments management with renv and venv are similar in motion to version control -- make some changes, see the effects, commit (snapshot or freeze) them. Similar to the Git Pane in RStudio, or the Git extension in VS Code, a renv or venv pane would make package snapshots and environments management more in the forefront and easier for users to adopt and thoughtfully manage their environments.

Having the repository source clearly identified as well (options("repos") or index-url from pip.conf) would go a long way in preventing surprises when packages are being installed from unexpected repositories.

One could even envision a close integration with Package Manager and ability to browse repo snapshots from the IDE.

kmasiello avatar Sep 25 '23 16:09 kmasiello

I think this could be a huge win for helping folks be successful and happy with renv (with which I am no expert, but I know more about that than virtual envs). I think it is a lot like Git where, for some folks, using a git client really helps them reach the next level of understanding and fluidity.

jennybc avatar Sep 25 '23 17:09 jennybc

Possibly for inspiration: https://marketplace.visualstudio.com/items?itemName=donjayamanne.python-environment-manager

image

jthomasmock avatar Sep 25 '23 21:09 jthomasmock

I think it's nice to note when Positron would have a feature that RStudio does not have and AFAICT this would qualify.

jennybc avatar Sep 25 '23 22:09 jennybc

make some changes, see the effects, commit (snapshot or freeze) them.

It is worth noting that this feature existed in RStudio once upon a time. We had pretty deep integration with Packrat, such that changes you made to the library would show up in the Packages pane where you could commit them, etc.

image

https://rstudio.github.io/packrat/rstudio.html

Unfortunately this feature was largely unused, unloved, and unsuccessful. I'm not sure why off the top of my head -- but we should probably think about it a little bit before embarking upon a similar adventure.

jmcphers avatar Sep 25 '23 22:09 jmcphers

Possibly for inspiration: marketplace.visualstudio.com/items?itemName=donjayamanne.python-environment-manager

FWIW, I do like this extension in Python! Its primary use case in my world is when trying I'm trying to look across multiple types of environments (eg, i have things installed in pyenv, venv, conda, and global python environments), which is a pretty Python-specific problem. I don't love the deeply nested dropdowns, but the information is easier to find than trying to remember each environment's specific commands 🙂

isabelizimm avatar Oct 04 '23 13:10 isabelizimm

In our Python OSS sync meeting this week, folks reiterated again how much they want to have a nice way to view/see their Python environment. Many folks are users of the existing extension linked above ⤴️ and would like something similar. Folks expressed that this is more about seeing their environment, confirming what's in it, and monitoring its status, and less about, say, installing packages.

juliasilge avatar Oct 07 '23 03:10 juliasilge

Another point -- currently, hitting the "Delete all objects" button also clears away any loaded modules/submodules. This is reasonable, but a bit unexpected since 1) those modules are not displayed anywhere in the Variables pane 2) the tooltip text "Delete all objects" doesn't indicate to me my modules will be unloaded and 3) the modal pop-up (Are you sure you want to delete all variables?) also doesn't indicate to me that my modules will be unloaded. image I think clearing away all the modules and submodules when I hit that button is probably a good thing, but the fact that there's zero connection between the loaded modules/packages and the Variables pane makes it pretty surprising

jgutman avatar Jan 18 '24 21:01 jgutman

It is very hard to check packages installed in R environment currently. Hope the feature will be considered soon

ntluong95 avatar Jul 22 '24 12:07 ntluong95

@ntluong95 For a temporary workaround, you can use sessioninfo::session_info() in the console.

juliasilge avatar Jul 22 '24 14:07 juliasilge

Another vote for a packages pane for R here: https://github.com/posit-dev/positron/issues/4260

jmcphers avatar Aug 07 '24 03:08 jmcphers

A suggestion here to provide more active/opinionated support for managing Python envs, and specifically generating requirements.txt in a smarter way than pip freeze: https://github.com/posit-dev/positron/discussions/4376

juliasilge avatar Aug 19 '24 14:08 juliasilge

Hello, are there any news on how is it going the work on adding this feature?

davidrsch avatar Sep 26 '24 11:09 davidrsch

There is a new extension from MS called Python Environment Manager. https://devblogs.microsoft.com/python/python-in-visual-studio-code-december-2024-release/

Not sure if the way to go Positron want to develop a new Environment Manager for both R/Python, and potentially more in the future, or are we fine with Python now?

ntluong95 avatar Dec 12 '24 00:12 ntluong95

I have made an extension to manage Python packages, maybe of your interest https://github.com/posit-dev/positron/discussions/7207

ntluong95 avatar Apr 13 '25 19:04 ntluong95

In https://github.com/posit-dev/positron/issues/9102 we have someone interested in the UI for updating packages that RStudio has.

juliasilge avatar Aug 20 '25 15:08 juliasilge

In https://github.com/posit-dev/positron/issues/9102 we have someone interested in the UI for updating packages that RStudio has.

@ntluong95 and I have written extensions which update packages for Python and R, respectively. However, my extension (for R) merely tries to find out updatable packages and call install.packages() on them.

kv9898 avatar Aug 20 '25 16:08 kv9898