Reputation: 1619
I am running OSX Catalina. After downloading Anaconda, I'm having trouble downloading external packages
. I tried in both the GUI and the terminal, but the process keeps getting stuck at "Solving environment".
I understand creating a new environment can be a workaround, but I would rather fix the issue at hand.
Any ideas?
Upvotes: 160
Views: 349827
Reputation: 337
Removing and reseting channels and activating my base env solved for me.
conda config --remove channels conda-forge
conda config --set channel_priority flexible
conda activate base
Upvotes: 0
Reputation: 876
In my case, trying to update a package (e.g. conda update sqlalchemy
) caused conda to hang during the 'solving environment' step, but asking Conda to install it (e.g. conda install sqlalchemy
) allowed the update to be made. In the latter case, the 'solving environment' step didn't take long at all. I'm not sure why this would be the case, but consider replacing 'update' with 'install' if you're having trouble with update operations.
Upvotes: 0
Reputation: 1378
cannot provide a solution but I have to say that it's not "stuck"
It's just sooooo slow.
Examining conflict for _anaconda_depends anaconda _ipyw_jlab_nb_ext_conf: 51%|███████████████████████▎ | 33/65 [14:53:43<14:00:25, 1575.79s/i|
Sometimes it looks like to be stuck because the prompt is not changing, but actually it's because the limited width of console is intercepting the prompt. Conda do have a progress bar and an estimated finish time.
Well yes, the time is deadly long, as long as several days on my old i5-8300H...but if you leave it alone and keep waiting it'll finally work.
20230509 update: Finally it's over after ~48h of running. This is a part of what it'll finally print out.
Package backports.functools_lru_cache conflicts for:
backports.functools_lru_cache
anaconda -> astroid==1.6.5=py27_0 -> backports.functools_lru_cache
conda-build -> conda-verify -> backports.functools_lru_cache
conda-verify -> backports.functools_lru_cache
_anaconda_depends -> backports.functools_lru_cache
prompt-toolkit -> wcwidth -> backports.functools_lru_cache
wcwidth -> backports.functools_lru_cache
spyder -> pylint[version='>=1.0'] -> backports.functools_lru_cache
anaconda -> backports.functools_lru_cache[version='1.4|1.5|1.5|1.6.4',build='py27h9586e20_1|py27_1|py_2|pyhd3eb1b0_0']
Package six conflicts for:
prompt-toolkit -> six[version='>=1.9.0']
conda-verify -> six
anaconda-navigator -> anaconda-client[version='>=1.6.14'] -> six
conda[version='>=4.13.0'] -> conda-package-handling[version='>=1.3.0'] -> six[version='>=1.5.2']
matplotlib-inline -> traitlets -> six
importlib_metadata -> pathlib2 -> six
pip -> html5lib -> six[version='>=1.9']
conda-build -> six
ipython -> prompt-toolkit[version='>3.0.1,<3.1.0'] -> six[version='>=1.9.0']
zipp -> more-itertools -> six[version='>=1.0.0,<2.0.0']
traitlets -> six
anaconda -> asttokens==2.0.5=pyhd3eb1b0_0 -> six[version='>=1.0.0,<2.0.0|>=1.10|>=1.4.1|>=1.5|>=1.9.0|>=1.6.0|>=1.5.2|>=1.15.0|>=1.13.0|>=1.12.0|>=1.4.0|>=1.9|>=1.11.0|>=1.12,<2|>=1.7.3|>=1.10.0|>=1.4']
pickleshare -> pathlib2 -> six
python-dateutil -> six[version='>=1.5']
ipykernel -> packaging -> six
Since it's gonna be reaaaally long, it would almost 100% take all of your console buffer. If you want to analyze the result be sure to redirect it into a file in advance.
Upvotes: 0
Reputation: 8950
Many good comments already - let me try to consolidate and add a few more thoughts:
The main background point is that conda is solving a boolean satisfiability problem https://en.wikipedia.org/wiki/Boolean_satisfiability_problem (colloquially: dependency hell https://en.wikipedia.org/wiki/Dependency_hell).
More details here: https://docs.conda.io/projects/conda/en/4.13.x/dev-guide/deep-dive-solvers.html
In the very early days, with relatively few packages, it was not the end of the world. Now, with many packages each with many versions, conda's non-optimised code can take forever.
If you know of any other potential solutions or suggestions, do share!
Lastly, I'd add that the newer versions of conda introduced parallel downloading, but, in my experience, the main bottleneck is not the download but solving the environment.
Upvotes: 30
Reputation: 13
In my case, I tried using the Visual Studio code terminal to create a new environment and install python version 3.6 with the following command,
conda create -n env_name python=3.6
But it hangs in the solving environment section.
The solution was to go to the anaconda prompt(run as admin),
first, deactivate base env
conda deactivate
create new env
conda create -n env_name
activate your new environment
conda activate env_name
Then do whatever you want in the env(in my case, I installed a specific version of python)
conda install python=3.6
Upvotes: 0
Reputation: 455
I faced the same issue for tensorflow and solved it by doing the next:
conda create -n tf tensorflow
conda activate tf
it worked and solved the issue, I think this happened due to not completing a previous install and got stuck in the middle.
Upvotes: 0
Reputation: 1950
The following works for me.
Spin-off on https://github.com/conda/conda/issues/11919
Instead of waiting (maybe hours) to resolve SAT (A well-known NP-Complete problem) environment, it would be helpful for you to install the faster Conda resolver (https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community). Just so you know, the resolver is not installed by default with Anaconda, so you need to install it manually.
sudo conda update -n base conda
sudo conda install -n base conda-libmamba-solver
conda config --set solver libmamba
Rerun conda install
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 \
-c pytorch -c nvidia
I hope you find it useful.
Upvotes: 14
Reputation: 21
set conda-forge highest priority, remove defaults channel
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --remove channels defaults
conda config --set channel_priority strict
make sure most your package from conda-forge, not defaults. If it doesn't work, try
conda update --all
conda clean -a //use with caution
Upvotes: 2
Reputation: 21
I've had this issue running macOS Monterey, with conda taking an age to solve the environment, failing, and causing immense frustration.
My first suggestion would be to install Mamba [1], of which you have two options. If conda does work, but just takes a long time, you can try
conda install mamba -n base -c conda-forge
If conda won't install anything at all, you can try uninstalling anaconda3 using conda install anaconda-clean
, then anaconda-clean --yes
, then rm -rf anaconda3
,rm -rf ~/anaconda3
and rm -rf ~/opt/anaconda3
. From there, download the Mambaforge .sh file [1], and run
bash ~/Downloads/Mambaforge-MacOSX-x86_64.sh
Follow the install, and treat mamba exactly how you would treat conda. Then it's simply a matter of selecting your interpreter in your IDE of choice! You'll find that mamba is way faster.
Failing this, you can try using which pip
, and then pip install [your package]
. I wouldn't advise this one for lots of packages, as you are essentially bypassing the dependancy check, however for small things, it should work fine. Try it, and uninstall it if you get any clashes. Happy fixing!
Upvotes: 2
Reputation: 1
Another solution that may not have been mentioned is that the dependencies that you may want to install within your conda env are already installed. Using conda-list within your env you may confirm.
With a package such as tethys platform they did not mentioned this and i was left wondering why my conda install process kept getting stuck at the solving stage. Late into the night bingo checked into my env and sure enough the dependencies where already installed. Now can progress to my next phase.
Upvotes: 0
Reputation: 149
For other weary travelers: if you find conda taking hours to solve an environment, try install packages one at a time. Works like a miracle.
Upvotes: 1
Reputation: 31
After some reading I found out the .condarc
file is not created by default (is stated by the official Anaconda documentation. So what I did is delete de .condarc
file and then used the following command
conda config --set channel_priority flexible
And then it got unstuck
Then I tried conda update conda
just to test it, and everything worked again.
Upvotes: 3
Reputation: 11
i had the same problem when i tried to install packages for my env i tried the conda env update -f environment.yml
even doesn't worked (in yml file i have name: tf2 that i point to update my env still doesnt upgraded)
but now which i tried this it worked :d
conda activate tf2
conda env update -n tf2 -f environment.yml --prune
Upvotes: 0
Reputation: 131
I was having the same issue while creating my conda environment using environment.yml file.
conda env create -f environment.yml
My issue was fixed by updating conda and setting channel priority to strict:
conda update conda
conda config --set channel_priority strict
Upvotes: 3
Reputation: 2623
Sounds very simple but make sure you're in your environment
conda activate <Your Environment>
Upvotes: 1
Reputation: 21
conda config --remove channels conda-forge
conda config --set channel_priority flexible
This fixed the problem with the solving environment step. After that I was able to update packages (such as conda and anaconda) and sort out various dependency issues.
Upvotes: 2
Reputation: 177
It might be taking long because of package version conflicts. My solution was to install some packages using pip instead of conda install. For example:
pip install tensorflow
Try this in a new environment so it doesn't mess up your existing ones.
Upvotes: 3
Reputation: 59
upgrading conda base package has fixed it. ref : https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html
Upvotes: 0
Reputation: 973
for updated conda version over 4.12.0
'Libmamba' with advantages like:
Improve conda’s resolving speeds by 50-80%*
Maximize backwards compatibility so as to not break any current
functionality
Build the plugin infrastructure for others to create custom solvers
are mentioned in Anaconda's official blog post, A Faster Solver for Conda: Libmamba
so for making libmamba your default solver(make sure your conda version is 4.12):
conda install -n base conda-libmamba-solver
and to try it temporarily:conda create -n demo --experimental-solver=libmamba --dry-run install <some package>
Upvotes: 7
Reputation: 77
I had similar problems trying to install external packages such as graph-tools and I solved it by creating a new environment. I know you prefer other options but it's the only thing that worked for me.
Upvotes: 1
Reputation: 1010
running
conda config --set channel_priority flexible
worked for me
Update, still ran into some issues so I found Mamba, and oh my god my life changed conda is the worst package manager ever
all my issues were solved when I used mamba
# install mamba
conda install -n base conda-forge::mamba
# use mamba
mamba install pandas
Upvotes: 63
Reputation: 145
Please, check that python is actually listed in environment.yml
or conda create -n your_environment --file requirements.txt python=3.7
.
Otherwise, conda is traversing all versions of python available.
Check that Python is listed.
Upvotes: 11
Reputation: 1958
you may also want to check your ~/.conda directory permissions. I installed conda on my MacOS using Homebrew and for some reason this directory had only read/write permissions for root. After changing the permissions and following the instructions from above, everything works smooth and fast now
Upvotes: 0
Reputation: 722
use this:
conda config --set channel_priority strict
pay attention that it is channel_priority and not priority_channel
Upvotes: 49
Reputation: 1
This fixed the hang for me. Although the install went on to fail.
conda config --set priority_channel strict
Upvotes: -3
Reputation: 14
Try installing ANACONDA3 2019-3. I had similar issues but after installing the above version of anaconda they were all fixed.
Upvotes: -3
Reputation: 11538
The following steps may work to resolve the issue.
conda config --remove channels conda-forge
conda config --add channels conda-forge
if it doesn't work then try this
conda update conda
if nothing works try seeing this github solution, it worked for many.
Upvotes: 71
Reputation: 32
Choose one:
check out the link for more details
This is another answer for environment failure, but for windows OS
Upvotes: -2