JDLL icon indicating copy to clipboard operation
JDLL copied to clipboard

Reducing python environment configuration time

Open pr4deepr opened this issue 9 months ago • 4 comments

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.

pr4deepr avatar May 16 '25 21:05 pr4deepr

Hello @pr4deepr Would you have a few benchmark data to articulate the effort required?

tinevez avatar May 17 '25 08:05 tinevez

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

pr4deepr avatar May 19 '25 04:05 pr4deepr

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 !!

carlosuc3m avatar May 23 '25 15:05 carlosuc3m

Thanks @carlosuc3m . Just to be clear, I meant:

  • use micromamba for configuring environments
  • install uv when creating an environment using pip.
  • use uv pip install instead of pip install for 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

pr4deepr avatar May 23 '25 20:05 pr4deepr