Conda tells me that there is an update available, but when I try to update, it doesnt work. I run conda update -n base -c defaults conda and get the following notification:
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.10.3
latest version: 22.11.1
Please update conda by running
$ conda update -n base -c defaults conda
# All requested packages already installed.
I cannot find a github repo for anaconda. What is the issue here? Running conda --version confirms 4.10.3 is installed. I installed anaconda through the Anaconda3-2022.10-Linux-x86_64.sh, so definitely not 4.10.3.
From the documentation:
#update the conda package manager to the latest version
conda update conda
#use conda to update Anaconda to the latest version
conda update anaconda
To update to a specific version of Anaconda, enter these commands:
#update the conda package manager to the latest version
conda update conda
#use conda to install a specific version of Anaconda
conda install anaconda=VERSION-NUMBER
Did you try these steps, including updating anaconda?
Related
I am trying to set up a conda environment with python 3.10 installed. For some reason, no install commands for additional packages are working. For example, if I run conda install pandas, I get the error:
PackagesNotFoundError: The following packages are not available from current channels:
- python=3.1
conda install -c conda-forge pandas doesn't work either. Not sure what the problem is.
Thats a bug in conda, you can read more about it here: https://github.com/conda/conda/issues/10969
Right now there is a PR to fix it but its not a released version. For now, just stick with
conda install python=3.9
Adding an answer as this issue has been fixed in the latest conda update. I faced the same issue in conda version 4.10.1 but it worked fine in version 4.11.0.
Update conda to the latest version with
conda update -n base -c defaults conda
Now install the required packages.
conda install -n py310 python=3.10 works for me.
Conda 4.10 is incompatible with python 3.10.
To use python 3.10 or newer, you need to update to conda 4.11+. If you cannot update conda, you need to revert to python 3.9 or older.
Read more on the on the link provided by vbraun. This reply is to clarify possibilities for the users.
Can also use the conda-forge channel:
conda install -c conda-forge python=3.10
We must create a new environment with latest version of python and change to this new environment inside anaconda navigator
I am trying to update the h2o package. When I run conda list h2o, this package is shown as
Name Version Build Channel
h2o 3.34.0.3 pypi_0 pypi
When I run conda update h2o it tells me.
PackageNotInstalledError: Package is not installed in prefix.
prefix: /opt/conda/anaconda
package name: h2o
How do I update this package?
#cel has correctly answered in his comment, all the credit goes to her/him!
You can see the conda list output that the package channel is pypi, this means that the package has been installed using pip.
If you want to upgrade it in place. This seems to be the simplest solution however mixing conda and pip packages in a conda environment is not advised since it can lead to dependency issues.
pip install --upgrade h2o
# check your installation
pip check
# No broken requirements found.
If you wan to uninstall it and replace it by a conda package.
# uninstall it
pip uninstall h2o
# install it with conda
conda install -c conda-forge h2o
Note: I've used the conda-forge channel but you can choose to use the default channel.
Maybe a better / safer solution could be to create a new conda environment from scratch with a fresh version of the package.
# will create a new env called my-env and containing the latest
conda create -c conda-forge -n my-env h2o
You will need to add also the other packages you need.
When I install the latest version of anaconda distribution, it comes with flask version 1.1.2. However, I need to install flask version 2.0. How can I install flask version 2.0 (in the base environment) while keeping other existing packages installed such as sklearn and numpy, etc.?
First do conda activate base,
Then you can either do pip install flask==2.0.0 or conda install -c conda-forge flask==2.0.0. Both are okay as long as you do conda activate base first.
You should consider creating a new environment for your project and not mess with the base environment.
First do conda create -n newname, then conda activate newname.
Then you can do conda install -c conda-forge numpy pandas sklearn flask==2.0.0, you can also do pip install numpy pandas sklearn flask==2.0.0. You can install everything you need in one line.
In a nutshell:
conda activate base
conda remove flask
conda install -c conda-forge flask
Line 1: to activate your base virtual environment
Line 2: in order to avoid any conflict, remove flask 1.1.2
line 3: install the latest flask version via the channel conda-forge (2.0.1 as for now)
If you want the 2.0.0 you should do this: conda install -c conda-forge flask=2.0.0
Explanations:
Channels:
conda uses channels (like repositories where the packages are stored). By default, the channel is the anaconda channel. So, if you installed flask with conda install flask that is the same as if you did conda install -c anaconda flask. And from this page (https://anaconda.org/anaconda/flask) you can see that the actual version on this channel is 1.1.2.
About the update part:
In general, to update all your packages in a virtual environment, you first have to activate your virtual environment with conda activate [virtual_environment_name] and then conda update --all.
But as you can see from the previous link, on the default channel (anconda), the latest version is 1.1.2, so, strictly speaking, you can't update flask to a version greater than 1.1.2.
But, because on the conda-forge channel the latest version is -as for now- 2.0.1, if you install flask from this channel, you will get flask 2.0.1.
Using pip in a Conda environment:
An other option mentionned by #anarchy too is to use pip install flask=2.0.0 but you should avoid that. See: https://www.anaconda.com/blog/using-pip-in-a-conda-environment and
Is that a bad idea to use conda and pip install on the same environment?.
About not using the base environment directly:
And in order to have a clean workspace, it's a good practice to create a virtual environment other than the base environment for your projects. You can create and then activate a new environment named for example "myenv" like this:
conda create -n myenv
conda activate myenv
And so the complete code would be:
conda create -n myenv
conda activate myenv
conda install -c conda-forge flask
And finally if you want to install the latest versions of other packages like numpy and sklearn, you should use conda-forge too:
conda install -c conda-forge scikit-learn
conda install -c conda-forge numpy
I would like to update conda to get the later version of python and its extensions but it keeps telling me this :
(base) C:\Users\pierr>conda update conda
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.2
latest version: 4.5.4
Please update conda by running
$ conda update -n base conda
# All requested packages already installed.
(base) C:\Users\pierr>conda update -n base conda
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.2
latest version: 4.5.4
Please update conda by running
$ conda update -n base conda
# All requested packages already installed.
Any help here please ?
There seems to be some documentation issue here. Apparently, 'conda update -n base conda' does not work any longer.
It seems that no one has fixed the documentation.
conda update --all
seems to work for me.
So I have an old version of conda install
conda -V
conda 4.5.4
the current version of anaconda is 5.1 and it is running python 3.6.4
I wanted to test my code base on the newer version of conda so I tought I could install a new env first with conda and it would give me the latest version of the conda distribution
conda create -n py364 python=3.6 anaconda
I thought this would be installing the latest anaconda with python 3.6.4 but it is actually installing python 3.6.1
is it possible to install the new anaconda version in a env?
It can depends on your environement.
Test: conda search python to see the available versions for your environement.
Have you tried: conda create -n py364 python=3.6.4 anaconda ?
as #darthbith suggested in the comments
you should always update your conda version using
conda update conda
then if you call
conda create -n py364 python=3.6 anaconda
it will install the latest distribution of anaconda on the with python 3.6.
or you could also call
conda create -n conda51 anaconda=5.1
to install the actual distribution you are targeting