Reducing python environment configuration time
For configuring cellpose or stardist python environments in DeepImagej, I noticed that you use 'pip' install. Have you considered using 'uv' ? It's a python package manager developed in Rusy You would install uv first using pip and then install packages using the syntax 'uv pip install PACKAGE'. It's extremely fast with resolving dependencies and installation. I prefer it more than mamba or pip.
Hello @pr4deepr Would you have a few benchmark data to articulate the effort required?
On Linux, I create an environment using
micromamba create -n stardist python==3.10 uv
Note uv is installed here
pip only
pip install tensorflow
pip install stardist
Took about ~1min 30 sec including download
cleaned pip cache and conda cache and created a new environment
Using uv
uv pip install tensorflow
resolved package for tensorflow 452ms
prepared packages in 31.35 sec
Installed in 8.44s
uv pip install stardist
resolved 22 packages in 801ms
prepared packages in 12.17s
Installed 19 packages in 3.53 s
Took under a minute including download..
Are there any specific packages or environments you'd like me to try?
For retooling, You could install uv as part of a new environment and perhaps substiute uv pip instead of pip ??
Best way to benchmark would be in the fiji plugin installation process of course, but i'm not sure how to build a jar with these changes and i don't code in JAVA either..
Cheers Pradeep
Hello @tinevez and @pr4deepr YEs uv is indeed faster than pip and it is one of the things crossing my mind. That and moving from micromamba to pixy, but for the moment until there is a version stable enough, we will probably still rely on pip and micromamaba.
Thanks for the suggestion @pr4deepr !!
Thanks @carlosuc3m . Just to be clear, I meant:
- use micromamba for configuring environments
- install
uvwhen creating an environment using pip. - use
uv pip installinstead ofpip installfor pypi packages
That's fair you want to wait till there is a stable enough version.
Thanks for the hard work on this.
Cheers Pradeep