Non source installation is missing dependencies
Hello,
The following recommended commands:
conda install -c conda-forge micro_sam
conda install -c conda-forge micro_sam "libtorch=*=cuda11*"
are missing dependencies.
cannot import automatic_segmentation (no module named micro_sam.automatic_segmentation)
get_predictor_and_segmenter
automatic_instance_segmentation.
Installing from source works fine. thx e.-
Hi @keesh0,
Thanks for your interest in micro-sam!
I can't seem to reproduce the issue you reported with a fresh installation. Can you try another fresh installation and tell me how that works? (and which piece of code / GUI returns the import errors you reported)
To install a fresh environment, conda env create -n test-sam -c conda-forge micro_sam should do the trick.
Sure. I am running the following commands after creating a fresh Conda environment through their GUI. I then pip install jupyter. Then run either command from this new Conda environment terminal: conda install -c conda-forge micro_sam conda install -c conda-forge micro_sam "libtorch==cuda11" After that I create a Jupyter notebook, which produces the previous errors.
Hi @keesh0,
Thanks for sharing the details. Hmm that's pretty odd because the commands you mentioned should work.
Can you activate your conda environment (using conda activate <ENV_NAME>, where replace <ENV_NAME> with the name of your environment) in the terminal / anaconda prompt, run python -c "import micro_sam; print(micro_sam.__version__)" and share with us the output?
I created a new Anaconda environment using Python 3.12.x. Installed jupyter from the Anaconda GUI.
Went to the terminal: conda install -c conda-forge micro_sam Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Solving environment: - # note this is very, very slow (hours on a nice developer box-- 64 GB RAM, 12 GB Nvidia GPU, lots of disk space) [update this comment when everything is installed]
conda install -c conda-forge micro_sam Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Solving environment: - # note this is very, very slow (hours on a nice developer box-- 64 GB RAM, 12 GB Nvidia GPU, lots of disk space)
If you run into issues then please make sure to:
- That you use the most up-to-date conda version and that you use libmamba for the dependency resolving. The original conda dependency resolver is very slow.
- The easiest way to use
libmambais to installmambain your base environment:conda install -c conda-forge mamba - And then create the env via
mamba create -c conda-forge -n micro_sam micro_sam
- The easiest way to use
I created a new Anaconda environment using Python 3.12.x. Installed jupyter from the Anaconda GUI.
Went to the terminal: conda install -c conda-forge micro_sam Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Solving environment: - # note this is very, very slow (hours on a nice developer box-- 64 GB RAM, 12 GB Nvidia GPU, lots of disk space) [update this comment when everything is installed]
I've met the same issue. At the begining, I felt that might be the problem from my conda environment. Acutally, I recreate some new environment or just install the library in my existed environment, they didn't work.
Hi @1244632315,
Acutally, I recreate some new environment
I would suggest trying to install in the new environment.
Could you send us more information (screenshots / output trace) of what it returns when you try to install micro-sam in a new environment? (this command should do the trick: conda install -c conda-forge micro_sam
Another important mention would be to the suggestion posted above by @constantinpape on validating that you are using the most up-to-date conda version and that you are using libmammba for the dependency resolving.
I just create a new environment to test the code "conda install -c conda-forge micro_sam", then the terminal will display (as the figure shows)
If installing the package is stuck at "Solving environment", I am quite confident that your conda package manager is using the original conda dependency resolver, which is infamous to be very slow.
I suggest taking a look at @constantinpape's suggestion above to take care of this issue: https://github.com/computational-cell-analytics/micro-sam/issues/982#issuecomment-2781334477
If installing the package is stuck at "Solving environment", I am quite confident that your conda package manager is using the original conda dependency resolver, which is infamous to be very slow.
I suggest taking a look at @constantinpape's suggestion above to take care of this issue: #982 (comment)
Thx for your patient replt! It did work.
Thanks for confirming @1244632315!
I'll go ahead and close this issue!
In case anyone stumbles upon this, please follow the suggestions carefully at https://github.com/computational-cell-analytics/micro-sam/issues/982#issuecomment-2781334477.
And @keesh0, please feel free to open a new issue, in case you are facing any!