anaconda/spyder scikit learn update 0.21.3 to 0.22.2
(base) mm#mm:~$ python --version
Python 3.7.4
(base) mm#mm:~$ anaconda --version
anaconda Command line client (version 1.7.2)
My scikit-learn version is 0.21.3 but I can't update to 0.22.2
I have tried multpile ways to update but I think this version is not included in my channels. I am using the default channels
How can I update sckit-learn using conda or any other possible way
my history (commands I have tried):
1509 conda update conda
1510 spyder
1511 conda list
1512 conda update scikit-learn
1513 anaconda
1514 navigator-updater
1515 conda list scikit-learn
1516 conda install scikit-learn=0.22.2
1517 conda install scikit-learn=0.22
1518 conda install scikit-learn==0.22.2
1519 conda install -c intel scikit-learn
1520 spyder
1521 history
And the error I get when trying to conda install:
(base) mm#mm:~$ conda install scikit-learn=0.22.2
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- scikit-learn=0.22.2
Current channels:
- 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
Not every package and not always the most recent versions of packages are available from the default channels when using conda install.
There are two ways you can check what is available from your configured channels:
conda search scikit-learn gives you a list of all packages that match the name scikit-learn and the available versions. On linux x64, this gives me this:
# Name Version Build Channel
<shortened to last few lines of list>
scikit-learn 0.22.1 py36h22eb022_0 pkgs/main
scikit-learn 0.22.1 py36hd81dba3_0 pkgs/main
scikit-learn 0.22.1 py37h22eb022_0 pkgs/main
scikit-learn 0.22.1 py37hd81dba3_0 pkgs/main
scikit-learn 0.22.1 py38h22eb022_0 pkgs/main
scikit-learn 0.22.1 py38hd81dba3_0 pkgs/main
So only 0.22.1 is available from the default channels. You can also check using anaconda.org where you can use the saerch function to get this:
Note the small gray numbers that indicate that anaconda / scikit-learn (the mirror of the default channel) only has version 0.22.1, in accordance with conda search output.
Note also that conda-forge / scikit-learn has your desired version, so you can use this command to install:
conda install -c conda-forge scikit-learn=0.22.2
Related
I'm trying to install py-xgboost-gpu on a Mac as XGBoost instructs on the website but I'm getting a PackagesNotFoundError
I'm running
conda install -c conda-forge py-xgboost-gpu
and getting
PackagesNotFoundError: The following packages are not available from current channels:
- py-xgboost-gpu
Any idea why?
GPU builds are for CUDA, which means NVIDIA hardware and Apple doesn't use that in their products. Hence, there is no such support. Instead, follow the instructions for CPU:
conda install -c conda-forge py-xgboost-cpu
Really, one shouldn't even need to specify:
conda install -c conda-forge xgboost
includes py-xgboost and on macOS it defaults to -cpu version.
I'm trying to set up tensorflow-gpu on my local machine to train neural networks on my RTX 2070 super. Unfortunately, I get the issue of the environment failing to solve, even in a brand new environment.
I originally tried to install tensorflow-gpu directly through Anaconda, but even with cudnn and cudatoolkit installed, it wouldn't recognize the GPU. I think it may be time to jump ship for pytorch...
Error codes;
(base) C:\Users\Albert>conda install -c conda-forge cudnn
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.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
The packages you are trying to install may be conflicting with your already installed packages. Try to create a new environment for tensorflow with a minimal set of packages:
conda create --name tf python cudnn -c conda-forge
conda activate tf
You can then install other packages with either conda or pip in this new environment.
In general, I find that creating separate conda environments for different tasks or projects is a better way to use conda
The conda documentation has details about managing environments
It's might occour because of the version conflict, you can just uninstall the python version in the existing conda environment or simply create new Conda environment.
To Change the python version-latest on existing environment:
conda uninstall python
conda install python -y
To create a new conda env
conda create -n <env-name> python -y
conda activate <env-name>
To install conda use any of the following commands:
conda install -c conda-forge tensorflow
conda install -c conda-forge/label/broken tensorflow
conda install -c conda-forge/label/cf201901 tensorflow
conda install -c conda-forge/label/cf202003 tensorflow
reference: https://anaconda.org/conda-forge/tensorflow
Try cleaning conda cache-files in case of error
I want to install a specific build of spyder on conda - version 3.3.0 with py36_a build.
# Name Version Build Channel
spyder 3.3.0 py27_0 pkgs/main
spyder 3.3.0 py36_0 pkgs/main
spyder 3.3.0 py37_0 pkgs/main
spyder 3.3.1 py27_1 pkgs/main
spyder 3.3.1 py35_1 pkgs/main
spyder 3.3.1 py36_1 pkgs/main
spyder 3.3.1 py37_1 pkgs/main
But when I do, I get an error that the package has not been found.
$conda install spyder=3.3.0=py36_1
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- spyder==3.3.0=py36_1
Current channels:
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/free/linux-64
- https://repo.anaconda.com/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/pro/linux-64
- https://repo.anaconda.com/pkgs/pro/noarch
I also tried conda install -c pkgs/main spyder=3.3.0=py36_1 but it gave me the same error. What's wrong here?
This is not really recommended,
and updating one or more dependencies to a version not tested together in the anaconda meta package is the likely reason for this problem in the first place.
However, the fact that updating,.. something...is requiring Spyder>=3.3.0 is worrisome, and seems to match what was reported on another thread. Could you please run
conda install spyder=3.3.0
and post your full output here, We need to know what's causing this issue.
And also dont't try to doing conda update --all.
Instead, you need to do below
conda remove spyder-kernels
conda install spyder-kernel==0.*
conda update spyder
My suggestion is simply to update the packages that you an update for:
conda update spyder, conda update pandas, etc.
Every time I use conda install -c some_channel to install a Python package, conda tries to update other packages from some_channel. From example, here I'm trying to install hdbscan from conda-forge, and conda wants to update ca-certificates as well.
The following NEW packages will be INSTALLED:
hdbscan: 0.8.18-py36h7eb728f_0 conda-forge
The following packages will be UPDATED:
ca-certificates: 2018.03.07-0 anaconda --> 2018.8.24-ha4d7672_0 conda-forge
certifi: 2018.8.24-py36_1 anaconda --> 2018.8.24-py36_1001 conda-forge
openssl: 1.0.2p-h1de35cc_0 anaconda --> 1.0.2p-h470a237_1 conda-forge
Proceed ([y]/n)? n
Note that conda tries to do this even if the package versions from the two channels are identical. So this is not just about upgrading to newer version.
Can I pin the channel for packages without pinning the version numbers? I wouldn't mind updating ca-certificates if the update comes from anaconda channel.
TensorFlow has multiple versions, if I want to install a specific version in Anaconda, which command should I use?
I find the existing answers unsatisfying, as the OP asked specifically about Anaconda but the answers are just pip installs.
You can list the available versions for install doing
conda search tensorflow-gpu
which should give you some output that looks like
Loading channels: done
# Name Version Build Channel
tensorflow-gpu 1.4.1 0 pkgs/main
tensorflow-gpu 1.5.0 0 pkgs/main
tensorflow-gpu 1.6.0 0 pkgs/main
tensorflow-gpu 1.7.0 0 pkgs/main
tensorflow-gpu 1.8.0 h7b35bdc_0 pkgs/main
tensorflow-gpu 1.9.0 hf154084_0 pkgs/main
tensorflow-gpu 1.10.0 hf154084_0 pkgs/main
tensorflow-gpu 1.11.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 1.12.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 1.13.1 h0d30ee6_0 pkgs/main
tensorflow-gpu 1.14.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 1.15.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 2.0.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 2.1.0 h0d30ee6_0 pkgs/main
tensorflow-gpu 2.2.0 h0d30ee6_0 pkgs/main
If you need to specify a particular channel, the -c/--channel option is your friend, for example:
conda search -c conda-forge tensorflow-gpu
Then you can select your version by passing it to the install command, for example:
conda install tensorflow-gpu==2.0.0
If you needed the channel option in your search, you should add the same option to the conda install command. Note this will work the same for tensorflow (i.e. not the GPU version), just change the package name accordingly.
YAML Configuration
If you use YAML environment configuration files, you can do the same thing:
# environment.yaml
name: my_conda_env
channels:
- conda-forge
dependencies:
- tensorflow-gpu=2.0.0
Create your environment with command:
conda env create -f environment.yaml
or if you change the version of an already created environment:
conda env update -f environment.yaml
This is probably the simplest way to do it:
pip install --ignore-installed --upgrade tensorflow==1.4
If you want to see all available versions, you can check out https://pypi.python.org/pypi/tensorflow/json
I would highly recommend you use virtualenv or conda to isolate your tensorflow installation, especially if you want to play-test different versions and the CPU/GPU versions.
I am assuming that you are using Windows, python3.5, and CPU version of tensorflow.
let's first create conda environment.
C:> conda create -n tensorflow python=3.5
C:> activate tensorflow
(tensorflow)C:> # Your prompt should change
After creating the conda environment successfully, issue the correct command to install the specific version. I will guide you through installing three different versions.
To install version r1.0
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
To install version r1.3
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.3.0rc1-cp35-cp35m-win_amd64.whl
To install master version
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.0-cp35-cp35m-win_amd64.whl
let me know if this is what you are looking for
To install specific version of python, tensorflow while creating conda environment:
conda create -n python=3.6 tensorflow=1.12.0
I have a older project which has dependency to run on:
Python: 3.7
Tensorflow: 1.13.1
For this I create a virutal environment using anancoda like:
conda create -n tf python=3.7 tensorflow=1.13.1
// here more modules with specific version can be added
After that we to activate env:
conda activate tf
after this ouput was:
(tf) D:\ff\testM>
Environment changed from (base) --> (tf)
(base) D:\ff\testM>
I have a older project which has dependency to run on:
Python: 3.7
Tensorflow: 1.13.1
To create i used ananconda:
conda create -n tf python=3.7 tensorflow=1.13.1
// here more modules with specific version can be added
conda activate tf //Activate environment
(base) D:\ff\testM> --> (tf) D:\ff\testM>
// environment changes from base to tf