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

Add an initial guide to virtual environments with micromamba #18

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

alisterburt
Copy link
Contributor

No description provided.

@alisterburt alisterburt changed the title Add an initial guide to virtual environments Add an initial guide to virtual environments with micromamba Aug 5, 2023
@@ -45,6 +45,7 @@ nav:
- tutorial/github/github_pages.md
- Guides:
- guides/index.md
- Virtual Environments: guides/environments.md
Copy link
Contributor Author

@alisterburt alisterburt Aug 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put at the top because it's early in the journey - is there a logical structure you're aiming at?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope not yet... just stuff I don't want to forget about

Copy link
Contributor

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you actually use micromamba as your daily driver?

I have tried it on a number of systems, and have found enough edge cases that I still tend to go for mambaforge these days...

I want to be able to use it all the time, but feel like it hasn't been stable enough

@alisterburt
Copy link
Contributor Author

I've been using it for a couple of months now without any big issues... curious to hear what you've run into?!

Windows installation does look a pain which is also a vote for mambaforge - the big thing for me is the lack of base env

@tlambert03
Copy link
Contributor

tlambert03 commented Aug 5, 2023

the big thing for me is the lack of base env

yep, totally agree. that would be a huge win for people not messing up their stuff. I honestly can't remember what the issues were! I just remember trying it on more than one occasion... feeling like everything was going great, and then running into some sort of hiccup that made me uninstall

I guess it's time to do it again :)

@alisterburt
Copy link
Contributor Author

The CLI definitely isn't at parity with conda - I remember something with channel config being different a while ago but that seems to be ironed out now! Give it a go and let me know what you think after a couple of weeks? If you run into any hiccups I can rewrite this against mambaforge no problemo

@tlambert03
Copy link
Contributor

here's a minor issue, that hints at more general issues of "support" across various tooling platforms:

at least without me doing something extra, VSCode is unable to determine the names of my micromamba environments:

Screen Shot 2023-08-05 at 4 05 01 PM

while it does fine for mambaforge:

Screen Shot 2023-08-05 at 4 06 49 PM

@tlambert03
Copy link
Contributor

related issue here:
microsoft/vscode-python#20919

(and I see our friend @psobolewskiPhD over there too 😂)

@psobolewskiPhD
Copy link

psobolewskiPhD commented Aug 5, 2023

I took the micromamba plunge, but haven't set up with VSCode yet.
I think aliasing mamba or conda to micromamba should fix it? It's a CLI tool, I can't imagine VSCode is doing anything sophisticated in the back.
(I actually made the mamba=micromamba alias, because of muscle memory...)

Edit: to note make this totally off-topic:
Is it worth mentioning micromamba is on brew?

Also one of the nicest mamba/micromamba things that I don't think vanilla conda does is:
repoquery https://mamba.readthedocs.io/en/latest/user_guide/mamba.html?highlight=repoquery#repoquery

I use search with this all the time, e.g.
mamba repoquery search mahotas
or if you want to check on a different arch:
CONDA_SUBDIR=win-64 mamba repoquery search mahotas
depends is nice too:
mamba repoquery depends -t mahotas -c conda-forge

Not sure it's in the scope of the guide though, maybe as a tip at the end? with a link to the docs?


</div>

Next, setup `micromamba` to download packages from

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Next, setup `micromamba` to download packages from
Next, setup `micromamba` to download packages exclusively from

maybe worth the emphasis?

```console
$ (my-env) ➜ conda install numpy
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note: you can append `--dry-run` to get a preview of what would be installed.

Not sure this is placed correctly or won't ruin formatting...

@tlambert03
Copy link
Contributor

I've have both conda and mamba aliased to micromamba, still no.

I wouldn't be surprised if they are making assumptions beyond simply running a cli command

@alisterburt
Copy link
Contributor Author

okay - I've come around on this, micromamba is not to be recommended - too many issues with surrounding tools. to mambaforge!

@psobolewskiPhD
Copy link

it's ok, time to move to pixi anyway!
https://github.com/prefix-dev/pixi
🤣
(I actually like the idea of envs tied into local dir/project dirs)

@tlambert03
Copy link
Contributor

Oh man 🤦‍♂️

(I actually like the idea of envs tied into local dir/project dirs)

Too bad was rejected then https://peps.python.org/pep-0582/

PDM does support the concept though

@tlambert03
Copy link
Contributor

found another case where micromamba didn't work:

when running benchmarks with asv, it looks for conda to make environments... and even though I had conda aliased to micromamba, it was still unable to build an env:

…/dev/self/psygnal via 🅒 psygnal took 2.3s …
❯ make benchmark-compare
asv run --interleave-processes --skip-existing main^!
· Creating environments
·· Failure creating environment for conda-py3.10-HATCH_BUILD_HOOKS_ENABLE1
·· Could not find 'conda' in PATH
make: *** [benchmark-compare] Error 1

…/dev/self/psygnal on  reduce-compare [$] via 🅒 psygnal
❯ which conda
conda: aliased to micromamba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants