I'm trying to update conda on my Mac to the latest version. In order to do so, I'm trying the usual command in my terminal -
conda update conda
However, it returns the error -
Preparing transaction: done
Verifying transaction: failed
RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.
I'm comparatively new to the conda environment. What is this error about and how can resolve it?
I am using Anaconda to build environments. I've been using pip install my_module the entire time, and I've recently realized this is incorrect. The environment I made is called dp_offfsets_environment and I have been able to run my flask app I wrote in IntelliJ using an SDK linked to this environment.
Why is this? Seen below, when calling conda list no packages are installed under my environment so I would expect my flask app to fail.
What is pip list displaying below? Is it showing packages installed in my base environment?
How do you recommend uninstalling these packages and moving them into the actual environment?
(dp_offsets_environment) C:\WINDOWS\system32>pip list
Package Version
---------------------- -------
click 8.0.3
colorama 0.4.4
cycler 0.10.0
Flask 2.0.2
fonttools 4.29.1
importlib-metadata 4.10.1
itsdangerous 2.0.1
Jinja2 3.0.3
kiwisolver 1.3.1
MarkupSafe 2.0.1
matlab 0.1
mysql-connector-python 8.0.26
packaging 21.3
pandas 1.3.0
Pillow 8.3.1
pip 22.0.2
pyparsing 2.4.7
python-dateutil 2.8.1
pytz 2021.1
setuptools 47.1.0
six 1.16.0
typing_extensions 4.0.1
Werkzeug 2.0.2
wheel 0.37.1
zipp 3.7.0
(dp_offsets_environment) C:\WINDOWS\system32>conda list
# packages in environment at C:\Users\ckurtz\.conda\envs\dp_offsets_environment:
#
# Name Version Build Channel
When you run conda create -n dp_offsets_environment, then conda creates an empty environment, i.e. with no packages. conda does not install python, pip or anything else in the environment. So when you run pip with that env activated, you will still get whatever pip is first located in your PATH (most likely from your base env).
So whenever you ran pip install nothing was installed to your currently active conda env and your flask app was probably not using that conda env, but also used the python that corresponds to your pip.
You need to install python/pip to your env and then install to your env.
See this as an example (I added annotation with ###):
(base) C:\Users\FlyingTeller>where pip
C:\Users\FlyingTeller\miniconda3\Scripts\pip.exe ### We are in base, so pip from base is found
(base) C:\Users\FlyingTeller>conda create -n someEnv
Collecting package metadata (current_repodata.json): done
Solving environment: done
Please update conda by running
$ conda update -n base conda
## Package Plan ##
environment location: C:\Users\FlyingTeller\miniconda3\envs\someEnv
### Note: No packages are being installed
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate someEnv
#
# To deactivate an active environment, use
#
# $ conda deactivate
(base) C:\Users\FlyingTeller>conda activate someEnv
(someEnv) C:\Users\FlyingTeller>where pip
C:\Users\FlyingTeller\miniconda3\Scripts\pip.exe ### <----- pip still from base env
(someEnv) C:\Users\FlyingTeller>conda install python pip
Collecting package metadata (current_repodata.json): done
Solving environment: done
Please update conda by running
$ conda update -n base conda
## Package Plan ##
environment location: C:\Users\FlyingTeller\miniconda3\envs\someEnv
added / updated specs:
- pip
- python
### Download and installation pruned
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(someEnv) C:\Users\FlyingTeller>where pip
C:\Users\FlyingTeller\miniconda3\envs\someEnv\Scripts\pip.exe ### Only now pip is in this env
C:\Users\FlyingTeller\miniconda3\Scripts\pip.exe
(someEnv) C:\Users\FlyingTeller>
Side Note
I've been using pip install my_module the entire time, and I've recently realized this is incorrect
This is a misconception of a commonly given advice "Do not use pip in a conda env". This advice is always a bit strong. There is no reason to refrain from using pip in a conda env all together. There is a good reason to be careful and aware of certain things that can easily break your env. There is also a good post on anaconda.org about this.
For anyone looking back on this, I discovered I had another instance of Anaconda on my machine. My company gives out laptops with Spyder installed which by default, has it's own version of Anaconda. I did not know Spyder came with Anaconda so I accidently installed two versions of Anaconda during my initial setup. To fix this I had to go through and uninstall both instances of Anaconda on my machine including their packages. Once completely removed, I reinstalled Anaconda, and my problems were alleviated.
I am tried to do setup tensorflow in anaconda.
I install Anaconda3-2019.03 which support pyhton3x. Now I learnt a lot and I could know that tensorflow doesn't works in Python 3.7.0 . That's why I update the Python version into Python 3.6.0 so that I can use tensorflow and I can install may be all packages but after all packages installation,
I run a command in anaconda promots,
conda install python=3.6.0
but it shown an error and that is,
Preparing transaction: done
Verifying transaction: failed
Note: How can i solve this issue?
Please help me. Advanced thanks.
YOu could create a new environment inside of conda dedicated for 3.6 with:
conda create --name py36 python=3.6
But then you also have to install tensorflow in there as well.
But Tensorflow works with Python 3.7.
I am using anaconda as below:
(base) C:\Users\xxx>conda info
active environment : base
active env location : C:\Users\xxx\Documents\ANACONDA
shell level : 1
user config file : C:\Users\xxx\.condarc
populated config files : C:\Users\xxx\.condarc
conda version : 4.7.11
conda-build version : 3.18.9
python version : 3.6.9.final.0
virtual packages :
base environment : C:\Users\xxx\Documents\ANACONDA (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/win-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\xxx\Documents\ANACONDA\pkgs
C:\Users\xxx\.conda\pkgs
C:\Users\xxx\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\xxx\Documents\ANACONDA\envs
C:\Users\xxx\.conda\envs
C:\Users\xxx\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.7.11 requests/2.22.0 CPython/3.6.9 Windows/10 Windows/10.0.16299
administrator : False
netrc file : None
offline mode : False
Now I have 2 issues that stop my work.
1) I cannot use conda install for any package.
It will give me the error in solving environment list this:
failed with initial frozen solve. Retrying with flexible solve.
then it will fail again and give message like this:
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
Even after the checking for incompatible packages, it didn't give me the solution.
2) When I want to upgrade or downgrade conda by the command:
conda update -n base conda
or
conda install conda = 4.6.11
It will give me errors again in the solving environment, and I think this is related to the first issue.
Now I cannot use conda for anything, please advise and thank you!
I ran into the same problem and I couldn't find a solution, but I did find a workaround. If you create an env and activate that env and then do the install, it seems to work just fine. If you don't need a lot of libraries I would try that.
Commands are:
Create env
conda create --name myenv
Activate the env
conda activate myenv
I started running in to this problem when one package suggested following modifications before installation
conda config --set channel_priority true
so I just reverted it and voila error's gone
conda config --set channel_priority false
I solved a similar problem by doing the following:
conda update --all --yes
You may downgrade to an older version of conda 4.6.14 and then install your packages.
conda config --set allow_conda_downgrades true
conda install conda=4.6.14
If your conda version is greater than or equal to 4.8, you may see that error.
(base) [localhost ~]$ conda --version
conda 4.8.2
(base) [localhost ~]$ conda install -c anaconda requests-kerberos
Collecting package metadata (current_repodata.json): done
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.
Downgrade your conda if possible using the following commands
conda config --set allow_conda_downgrades true
conda install conda=4.6.14
Then create your virtual environment:
conda create --name myenv_conda
Then activate your myenv_conda
conda activate myenv_conda
Now try to install packages using conda -c install anaconda
eg: conda install -c conda requests-kerberos
output:
(myenv_conda) [localhost ~]$ conda install -c anaconda requests-kerberos
Collecting package metadata: done
Solving environment: done
....
....
....
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
https://stackoverflow.com/a/61117831/7802476 helped me. Creating a new environment using the accepted answer didn't get my jupyter notebook to recognize the installed opencv. I could only import cv2 when I was in the environment on my terminal.
The fix was to use pip instead of conda, pip install opencv-python
I run into same problem while installing geopandas. The issue was gone after I upgraded to a newer version of Anaconda using:
conda update --prefix C:\apps\anaconda3 anaconda
Note: you'll have to modify the path C:\apps\anaconda3 pointing to your own installation directory.
Strangely, I did download Anaconda from the official homepage just a few hours ago and thought I had the newest version...
I had same problem but I solved because of SKİD.
After you create new env, You can run one of the codes in this link.
https://anaconda.org/rdkit/rdkit
I've generally had good results with conda and pip, but learned over time that environments really can get broken by unusual combinations of packages, and just starting a new env from scratch is often the only way forward. In my case it was tensorflow-gpu that wouldn't install from conda-forge, into an env I'd already been using for some weeks. The list of packages cited as being incompatible was in the dozens. I tried all the things listed on this page, but in the end I just hammered out a new env. Since I was deducing what packages I needed to install in the new env by running my program and installing one package at each error (ie instead of being methodical about listing my former env), along the way I reproduced this frozen solve thing several times. Each time it happened, I shuffled that conda package back to the initial conda create command and started again. Eventually my program ran in the new env, with tensorflow-gpu imported, and the root cause was revealed as conda installs which occur after pip installs. It wasn't anything to do with conda version or conda config.
A specific note for anyone using opencv-python, I ended up needing to install qt via conda, before attempting to install opencv-python via pip. That was a tricky one because it's a runtime error, and on stack overflow many of the solutions refer to various qt lib requirements which aren't part of python/conda and which I already had.
A further specific note. Some pip installs will roll back a version of a related package, thus breaking other conda-installed packages. In my case the example was a package called peakutils rolling back numpy, which then broke a from numpy import ma in scale.py module in the matplotlib package. My head is still spinning.
Create a new environment if your are not superuser, after that activate environment to install packages
Recommend to upgrade conda latest version.
conda install --quiet --yes conda=4.7.11
python -m pip install --upgrade pip==19.2.2
I'm running Mac OS X 10.14.1 (18B75), Python 3.7.0 and conda 4.5.11. I tried to create a new environment:
conda create -n cv-final python pip
It asked to install new packages and I press 'y' to proceed, but then it threw errors:
Preparing transaction: done
Verifying transaction: failed
CondaVerificationError: The package for ncurses located at /Users/johan/anaconda3/pkgs/ncurses-6.1-h0a44026_0
appears to be corrupted. The path 'share/terminfo/69/iTerm.app'
specified in the package manifest cannot be found.
CondaVerificationError: The package for ncurses located at /Users/johan/anaconda3/pkgs/ncurses-6.1-h0a44026_0
appears to be corrupted. The path 'share/terminfo/69/iTerm2.app'
specified in the package manifest cannot be found.
I've tried conda clean --packages --tarballs as suggested here, but no luck.
Running
conda env create cv-final
does create a new empty environment, but trying to install packages
conda install -n cv-final python pip
will still get the same errors.