Anaconda install new packages without updating conda - python

I am trying to install a python package by using conda install. It pops this message and halt:
Does it mean I have to update conda first? Is it possible to install new packages without updating to the latest version?

According to this answer from the Anaconda GitHub, one can achieve what you are looking for through conda install <package> conda=X.X where X.X is your conda version.
Additionally, one can suppress the conda auto-update through the following command conda config --set auto_update_conda false

It is preferred to have latest Conda version to install packages.Updating Conda is easy. The terminal also shows you the respective command for this.
You can find more help here: Conda update

Related

conda update conda does not update conda

I had some problems with anaconda, so I decided to uninstall and reinstall it.
To do that I used anaconda-clean and ran the following command:
rm -rf ~/opt/anaconda3
The version that was installed is 4.12.0 and I wanted to update to the most recent, 22.9.0, but whenever I run
conda update conda
or
conda update -n base conda
and check the version
conda --version
I keep getting 4.12.0
Is there a way to solve this or find out if something went wrong when I deleted/installed anaconda?
Thanks!
Lu
Running conda update conda will make a best-effort attempt to update your environment. Unfortunately, you may have packages installed that prevents the update.
You can alternatively try a more explicit install:
conda install -n base conda=22.9.0
If this still fails please open an issue at https://github.com/conda/conda so the conda team can help debug further.
You likely have an old version of python in your base env with dependancies preventing automatic python update.
Running conda update python may solve this problem.
alternatively, you can install a specific version of python explicitly e.g.,
conda install python=3.9

How to install Geo Pandas package in Jupyter Notebook in Python ? All solutions do not work

How to install geopandas, I really tried everything and I still has error: ModuleNotFoundError: No module named 'geopandas'. I have the latest version of Python 3.9.6. I use Windows 10, I use Anaconda Prompt, I have only one version of Python.
I do not want to create other environment, I want to install it as any other package, how to do it? I tried:
pip install geopandas
conda install --channel conda-forge geopandas
!conda install geopandas
I checked also this page: https://geopandas.readthedocs.io/en/latest/getting_started/install.html to find solution but I still do not have this package. But package folium was installed correctly by pip install folium.
Help me because I try to do in second day in a row ;/
I will transcribe here the solution I found; all glory goes to Mr. Tanish Gupta, long life to him. Source here :). I hope it helps!
I did this in my win10 PC, I have Anaconda 2.1.4 and only the Python version which comes with it (3.7 I believe). I use Anaconda Prompt, I have only that one version of Python ('cause I had the latest Py ver, but outside Anaconda, and tried this. It worked, but for that 3.10 Python version, not for the Jupyter Py ver, if that makes sense).
To my understanding, probably there is some incompatibility between the libraries installed in the base environment, so we'll be creating a new one.
In the Anaconda command prompt, create a new environment variable:
conda create -n geo_env
Activate this environment “geo_env”, then add and set conda-forge channel:
conda create -n geo_env
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
Install Geopandas in the environment just created:
conda install geopandas
Next install Jupyter notebook in this environment:
conda install jupyter notebook
Note: If the above command doesn’t work for you, try conda install notebook.
Now add our environment to Jupyter notebook:
python -m ipykernel install --name geo_env
Change to our new environment in the AnacondaNavigator. Enjoy :D
In my case, then I had issues with seaborn and wordcloud in this environment, so I tried installing C++, 'cause it said in the error output, you know, I just wanted more headaches (it didn't work). Finally I installed them in the same way explained before and everything ran smoothly.
If I'm not mistaken you're either having a conflict between channels or you forgot to install geopandas packages when doing it with pip.
First of all, in an anaconda prompt, start by cleaning your environment by removing the packages that got installed by pip.
To do so just pip uninstall geopandas fiona pyproj rtree shapely.
Once you're done with that, run a conda install --channel conda-forge geopandas (normally should work).

Is "conda update --all" good enough to upgrade to latest anaconda version?

The latest anaconda version is 2020.11.
I am using anaconda python 2020.7. Will conda update --all be good enough to upgrade my existing version to 2020.11? Are there things that I am missing out if I don't install 2020.11 directly from installation file?
The conda update --all works to update the anaconda package management system, you can also use the conda update anaconda=VersionNumber. For more detailed info check this website
https://docs.anaconda.com/anaconda/install/update-version/
You can easily update Anaconda to the latest version.
Enter these commands:
conda update conda
conda update anaconda=VersionNumber
From conda website, you can use conda command to upgrade to latest v2020.11 as of 24Jan2021.
https://www.anaconda.com/blog/individual-edition-2020-11
You can find the full release notes for Anaconda Individual Edition
2020.11 here.
Update to Anaconda 2020.11 now with conda install anaconda=2020.11, or
download and install Anaconda 2020.11.
So, the right command to run is conda install anaconda=2020.11

Installing python packages on anaconda on macos

This may be a silly simple question, but I couldn't find an answer in the documentation of Anaconda or elsewhere. I am a bit of a noob when it comes to Python and I am trying to install a package. The problem is generalizable to other packages.
specs
I am working on a macOS Catalina (10.15.5) and using Anaconda as my python environment (python2.7).
problem
I am attempting to install the package pyLDAvis in my python environment, but the package isn't available on Anaconda's environment manager, and pip or conda install isn't working on the Spyder shell. Do pip and conda installs only work on the Anaconda Prompt? The problem is that I have read that the Anaconda Prompt only exists on Windows, and I am on mac. How could I install packages (pip, conda, or else) on Anaconda?
Am I missing something?
Any help or pointers to documentation would be great! Thanks
Assuming you have conda already installed and your shell is properly configured, you can activate the base environment via
conda activate
You can also create a new environment, see manage-environments docs.
For more information than given below, see manage-pkgs docs.
In case of conda, after your environment is activated, you can then install a package via conda install <package name>, e.g. the package numpy
conda install numpy
In case of pip, after your environment is activated, you can then install a package via pip install <package name>, e.g. the package numpy
pip install numpy
I only do this if the package is not available via a conda channel.
If the package is also not available via pip, you can download the source and set the package up your self. Usually the package author describes how to set up his/her package.
Thanks Stefan for the suggestion! I struggled a bit because although conda was "already installed", my shell was indeed not "properly configured." I am writing here my solution because it may be a recurring theme for macOS users and had an easy fix.
Starting with macOS Catalina, macOS uses zsh and not bash as the default shell, and so calling conda on zsh had no effect. The error message was: -zsh: conda: command not found. I solved this by changing the default shell to bash by running the following command: chsh -s /bin/bash.
Now that the shell and conda are properly configured, I managed to use conda activate as you suggested Stefan.
Finally, the package pyLDAvis could not be installed by conda install pyldavis but was installed with pip install pyldavis.
Solved!

Can conda coexist with pip?

Maybe is a stupid question but I would like to install a python package that is in conda but not in pip. This is the package:
https://wrf-python.readthedocs.io/en/latest/installation.html
I don't have conda installed. My concern is that can conda coexist with pip? In other words, if I install conda and install that package, I would be able to use it with all the packages that I already have installed in pip?
thanks
You can do this by running
conda config --add create_default_packages pip
and pip will be installed in any new environment.
But, the whole point of conda is for it to work better than pip, so I would suggest using conda instead of pip at all times.

Categories

Resources