Condas solving environment takes forever

2024/11/17 14:49:48

I am using conda since one year, since several weeks, whenever I want to install a package using conda install -c anaconda <package_name>, for any package, it is just stuck at the Solving environment step.

I just want to install, for example, sympy or mpmath for Python...

Is there some magic command to solve this problem ?

Thanks and regards

Answer

Use pip instead of conda.

Nowadays, Conda is pretty much broken because its native algorithm does not scale with the number of packages in real-world applications. Its developers are stubborn and reluctant to change and adapt, turning the toolkit more and more useless and hopeless.

FYI, both pip and conda are Python package managers (developed by different groups of people).

For common Python package installation such as sympy and mpmath, you can

  1. either use Python pip installation:
~/anaconda3/bin/python -m pip install sympy mpmath

(if your anaconda3 is installed in your home folder, at ~/anaconda3; this command will install Python packages into any folder that your anaconda3 is currently located at (or installed at), e.g., if your anaconda3 is installed at /anaconda3 but moved to /opt/anaconda3, then running /opt/anaconda3/bin/python -m pip install sympy mpmath will install anaconda3 into /opt/anaconda3; you can run /opt/anaconda3/pip install sympy mpmath if your anaconda3 is originally installed at /opt/anaconda3 and not relocated) to install the packages into anaconda3's folder, i.e., ~/anaconda3/lib/python3.*/site-packages/

  1. or Linux native installation (e.g. for Ubuntu/Debian-based-Linux):
apt-get install python3-sympy python3-mpmath

to install the packages into the system folder, i.e., /usr/lib/python3/dist-packages/

  1. If you use Python conda installation:
~/anaconda3/bin/python -m conda install sympy mpmath

you often need to wait for hours and might end up with failure or even a corrupted anaconda installation (which I have encountered once in a while and then have to re-install anaconda3 completely).

Some notes to conda developers:

  • by default, you should not perform a full check on the integrity of all installed packages, just keep an index file listing each package's installation state
  • add an option to perform full integrity check on all packages. Since your full integrity check is on per-file level, maybe it can find and solve some conflicts that pip cannot do.
https://en.xdnf.cn/q/71184.html

Related Q&A

How to overwrite a file in Python?

Im trying to overwrite a file. I based my answer on this Read and overwrite a file in PythonTo complete my codes:<select class="select compact expandable-list check-list" ONCHANGE="lo…

Is os.popen really deprecated in Python 2.6?

The on-line documentation states that os.popen is now deprecated. All other deprecated functions duly raise a DeprecationWarning. For instance:>>> import os >>> [c.close() for c in os…

Routes with trailing slashes in Pyramid

Lets say I have a route /foo/bar/baz. I would also like to have another view corresponding to /foo or /foo/. But I dont want to systematically append trailing slashes for other routes, only for /foo a…

understanding item for item in list_a if ... PYTHON

Ive seen the following code many times, and I know its the solution to my problems, but Im really struggling to understand HOW it works. The code in particular is:item for item in list_a if item not in…

Django redirect to custom URL

From my Django app, how to I redirect a user to somescheme://someurl.com?To give you some context in case it helps, I have a working oauth2 server written in Python/Django and I need to allow users to…

Python embedding with threads -- avoiding deadlocks?

Is there any way to embed python, allow callbacks from python to C++, allowing the Pythhon code to spawn threads, and avoiding deadlocks?The problem is this:To call into Python, I need to hold the GIL…

RuntimeError: Event loop is closed when using pytest-asyncio to test FastAPI routes

I received the errorRuntimeError: Event loop is closedeach time I try to make more than one async call inside my test. I already tried to use all other suggestions from other Stack Overflow posts to re…

Adjust threshold cros_val_score sklearn

There is a way to set the threshold cross_val_score sklearn?Ive trained a model, then I adjust the threshold to 0.22. The model in the following below :# Try with Threshold pred_proba = LGBM_Model.pre…

Efficiently insert multiple elements in a list (or another data structure) keeping their order

I have a list of items that should be inserted in a list-like data structure one after the other, and I have the indexes at which each item should be inserted. For example: items = [itemX, itemY, itemZ…

matplotlib versions =3 does not include a find()

I am running a very simple Python script: from tftb.generators import amgauss, fmlinI get this error: C:\Users\Anaconda3\envs\tf_gpu\lib\site-packages\tftb-0.0.1-py3.6.egg\tftb\processing\affine.py in …