Update of scikit-learn fails with Anaconda - python

I'm using Anaconda. When I do conda list it shows me that currently scikit-learn 0.19.1 is installed. I would like to upgrade to 0.19.2, so I'm doing
conda config --append channels conda-forge
conda install scikit-learn=0.19.2
But then I'm getting the following error:
PackagesNotFoundError: The following packages are not available from current cha
nnels:
- scikit-learn=0.19.2
Current channels:
- 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/pro/win-64
- https://repo.anaconda.com/pkgs/pro/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
How can I install scikit-learn 0.19.2?

scikit-learn==0.19.2 You're missing a second = sign, so it's not finding the package
$ pip install scikit-learn=0.19.1
Invalid requirement: 'scikit-learn=0.19.1'
= is not a valid operator. Did you mean == ?

Related

Conda can't install packages from requirements.txt available in conda-forge, although package exists in conda-forge

I added conda-forge to the conda channels:
$ conda config --show channels
channels:
- conda-forge
- defaults
my requirements.txt contains, among others, these lines:
ipython-genutils==0.2.0
jupyter-client==6.1.12
jupyterlab-pygments==0.1.2
appnope==0.1.2
jupyterlab-widgets==1.0.0
data==0.4
prometheus-client==0.11.0
latex==0.7.0
scipy==1.5.4
jupyter-core==4.7.1
jupyter-console==6.4.0
async-generator==1.10
vg==1.10.0
sklearn==0.0
postgis==1.0.4
When I try to create a new environment from this requirements.txt using conda with
conda create --name myenv --file requirements.txt
I get the following errors:
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- ipython-genutils==0.2.0
- jupyter-client==6.1.12
- jupyterlab-pygments==0.1.2
- appnope==0.1.2
- jupyterlab-widgets==1.0.0
- data==0.4
- prometheus-client==0.11.0
- latex==0.7.0
- scipy==1.5.4
- jupyter-core==4.7.1
- jupyter-console==6.4.0
- async-generator==1.10
- vg==1.10.0
- sklearn==0.0
- postgis==1.0.4
Current channels:
- https://conda.anaconda.org/conda-forge/linux-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
As you can see, conda-forge is listed under "current channels" and ipython-genutils==0.2.0 is available in conda-forge. However, the package is not found. How can I fix this problem?
I tried both conda config --set channel_priority flexible and ... stable
I run Ubuntu 20.04 LTS, Python 3.10 and Conda 4.12.0
It looks to me like this should have been a requirements.txt to be used by pip. Note that conda packages can have slightly different names than what is available on pypi.
ipython-genutils is not the correct name, looking at the link you have provided, the name of the package is ipython_genutils with an underscore. The same is true for the other packages that you have written with a hyphen. They should all be spelled with an underscore.
That leaves
- sklearn==0.0
- latex==0.7.0
- vg==1.10.0
- scipy==1.5.4
- postgis==1.0.4
- data==0.4
- appnope==0.1.2
sklearn==0.0 seems to be a corrupt line in your file. The package's name is scikit-learn. latex, vg and data are not available on conda channels as far as I can tell. The same goes for scipy==1.5.4, only 1.5.3 and 1.6 are available. postgis only goes back to 2.4.3 on conda-forge , see here, but also seems to be different from what is available on pypi. appnope is a package only available for macOS, see it's description:
Simple package for disabling App Nap on macOS >= 10.9, which can be problematic.
So with that in mind, we can create a yml file that installs from both conda channels and from pip (Changes to your file: replaced - with _, removed appnope, added pip dependency, renamed sklearn to scikit-learn and moved it together with latex, scipy, vg, data, postgis to pip requirements. If you are flexible with scipy==1.5.4, I would advise to change it to scipy==1.5.3 or scipy==1.6.0 and move scipy and sklearn out of the pip installed packages):
name: myenv
dependencies:
- ipython_genutils==0.2.0
- jupyter_client==6.1.12
- jupyterlab_pygments==0.1.2
- jupyterlab_widgets==1.0.0
- prometheus_client==0.11.0
- jupyter_core==4.7.1
- jupyter_console==6.4.0
- async_generator==1.10
- pip
- pip:
- scikit-learn
- latex==0.7.0
- scipy==1.5.4
- vg==1.10.0
- data==0.4.0
- postgis==1.0.4
Save this as environment.yml and then do
conda env create -f environment.yml

Anaconda is unable to update/install packages

When trying to upgrade my anaconda distribution I keep getting the following error:
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- pkgs/free/win-64::anaconda==4.4.0=np112py36_0 -> bzip2==1.0.6=vc14_3
- pkgs/free/win-64::anaconda==4.4.0=np112py36_0 -> cryptography==1.8.1=py36_0
[loads of similarly cryptic packages names]
- pkgs/free/win-64::anaconda==4.4.0=np112py36_0 -> vs2015_runtime==14.0.25123=0
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/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
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
This is raised no matter what or how I try to install/update:
It is raised both with conda update --all and conda update numpy or any other package I tried, so this should not be due to some specific package that is not in the channel.
It is even raised when I try to update anaconda itself by conda update -n root conda.
I have tried updating numpy from Anaconda navigator.
Because of this question I added conda-forge to my channels - to no avail.
Grateful for any help.
EDIT: I finally solved this by completely removing and reinstalling Anaconda3, but I still lack an understanding of what exactly has originally caused the problem.

Package not found error while installing CuSpatial or CuDf library

So, to calculate Hausdorff Distance in a short time I found a CuSpatial library or cudf library. But while trying to install it through the Anaconda Promt conda install -c rapidsai-nightly cuspatial i get the following:
PackagesNotFoundError: The following packages are not available from current channels:
cuspatial
Current channels:
https://conda.anaconda.org/rapidsai-nightly/win-64
https://conda.anaconda.org/rapidsai-nightly/noarch
https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/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
To search for alternate channels that may provide the conda package
you're looking for, navigate to
https://anaconda.org
Sorry, but no win-64 builds are available for that on Anaconda Cloud. The developers only seem to support Linux 64, but I suppose if you're adventurous you can attempt a build from source.

unable to install "camelot", "ghostscript" on Visual Studio 2017

I have a Python 3 environment inside Visual Studio 2017. I have been trying to install "camelot" package, which required "ghostscript" and "tk" (tkinter) packages to be pre-installed. I was successful in installing "tk", but no luck with "ghostscript". When I try to install "ghostscript", I get an error stating-
----- Installing 'camelot' -----
Solving environment: ...working... failed
PackagesNotFoundError: The following packages are not available from current channels:
- camelot
Current channels:
- 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/pro/win-64
- https://repo.anaconda.com/pkgs/pro/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
----- Failed to install 'camelot' -----
Any help regarding this would be much appreciated
P.S- I have downloaded the "ghostscript" executable file and added it to the path of environment variables
I had been trying to install "ghostcript" just as a pre-requisite for "camelot". I visited this website- https://anaconda.org/conda-forge/camelot-py and entered "conda install -c conda-forge camelot-py" in Visual Studio's Python environment. And it worked!
conda install is prefixed to every package you enter. Hence just enter "-c conda-forge camelot-py " in the python environment tab.

How to deploy Django (via Anaconda) to Heroku with django_heroku

I am trying to deploy my first Django application to Heroku. I'm using anaconda for python, and following Deploying Python from Heroku, and the recommendation is to use django_heroku package.
I cannot find this package and get the following message when using:
conda install django_heroku.
Does anyone know where this package is? Is this necessary, or is there another way?
PackagesNotFoundError: The following packages are not available from current channels:
- django_heroku
Current channels:
- 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/pro/win-64
- https://repo.anaconda.com/pkgs/pro/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.

Categories

Resources