'UnsatisfiableError' while trying to install scikit-learn - scikit-learn

I need sklearn that's why I tried installing scikit-learn in my conda env using conda install scikit-learn but it results in:
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- scikit-learn -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.5,<3.6.0a0']
Your python: python=3.9
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
The following specifications were found to be incompatible with your system:
- feature:/linux-64::__cuda==9.1=0
- feature:|#/linux-64::__cuda==9.1=0
Your installed version is: 9.1
The same appears if I try conda install -c anaconda scikit-learn or conda install -c conda-forge scikit-learn. How to resolve this?

Ok, so the problem was that my env was running Python 3.9.0 but scikit-learn isn't compatible with 3.9 so I created a new env while specifically mentioning the Python version by
conda create -n newEnv python=3.7.3
python 3.7.3 was running in my base environment so I chose that.

I have just encountered this problem, and my OS is Windows10. At first I tried to uninstall scikit-learn package and reinstall it, but it failed. Then I searched this website which focuses on python package using wheel. Luckily scikit-learn compatible with python3.9.0 now is available. After downloading the proper wheel file, I cd into the download folder and use 'pip install <wheel file name>' to install it. It worked for my situation. Wishes for you.

Related

How to install shapely via .whl when "not supported wheel on this platform"

all. I am trying to install shapely via the .whl using pip. I have python 3.6.13 running on anaconda prompt. I have downloaded the shapely .whl using this site. However, when I run the commands shown in the image below, I get the error "shapely... is not a supported wheel on this platform."
From what I understand, I have a 64 bit architecture and python 3.6 (although it is python 3.6.13). I have tried to just request python 3.6 flat from the virtual environment setup by using the following command:
conda create -n stormEnv python=3.6
However, this command always returns a python version that is higher than a flat 3.6.
I am wondering if there is a way to get a python version that is a flat 3.6, or if I am just using the wrong .whl file from https://www.lfd.uci.edu/~gohlke/pythonlibs/
I have also tried the 3.6 32bit architecture as shown in the next image without any success:
Thanks for any help you can provide.
Since you're working with conda, the first thing you should try is:
conda install shapely
There is likely to be an existing build for your platform available in conda forge.
Wheel files are tagged with compatibility markers, and you should not attempt to install an incompatible wheel directly, because the the compiled artifacts inside the wheel will not work on your platform. You'll have to find a wheel which is supported on your platform - to see the list of supported tags run:
python -m pip debug -v
If there are no compatible wheels available, you'll have to install the necessary build dependencies and then install directly from source code.

Issue while installing a lower python version in conda prompt

I have python version 3.8.8 in conda. I want version 3.5.0 for a Machine learning project but when I ran the command conda install python=3.5.0, following output came:
**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:
python=3.5.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
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.**
I am not able to comprehend this. How can I install the required python version?
Good thing with conda is you can maintain as many versions of python as you want simultaneously but you're trying to modify the main distribution of python that comes with the conda that you've installed. What you should do is create a new environment with the desirable python version.
Create a new environment for your ML-related work using
conda create -n ml_env python=3.5.0
conda activate ml_env
This way, if you no longer need the stuff you installed for ML, you can easily remove the whole environment:
conda env remove -n ml_env

Remove nodejs with Conda in JupyterLab [duplicate]

I'm trying to use python packages in R, but I keep getting the same error:
ImportError: cannot import name 'read_csv' from 'pandas' (unknown location)
I cant use "py_install" neither:
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- python=3.1
Current channels:
- 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
and use the search bar at the top of the page.
Error: one or more Python packages failed to install [error code 1]
I have tried to specify my folder in which the packages are in, but it doesn't work.
Hope you guys can help.
My code:
library(reticulate)
use_condaenv("C:/Users/Bruger/AppData/Local/r-miniconda/envs/r-reticulate")
import("pandas")
py = py_run_string
py("import pandas as pd")
py("from pandas import read_csv")
Conda 4.10 is incompatible with python 3.10.
The issue is not related to R, and maybe there is nothing wrong with your code. The same type of problem occurred at the following SO issues:
PyTorch installation asks for python=3.1 . Python Version installed: 3.10.0
Trying to install Earth Engine on R; python=3.1 not available
Why can't I install matplotlib or pandas with pip OR miniconda?
Solutions
If you need python 3.10+
If you need python 3.10 or newer, you must have conda 4.11 or newer. Install the desired conda version, or switch to the base environment and update conda using conda update conda. Something like:
conda activate base
conda update conda
conda create --name r-reticulate python=3.10 pandas numpy scipy matplotlib scikit-learn
conda activate r-reticulate
You may need to add non-default channels to your conda, as I get an UnsatisfiableError using it. By using the conda-forge channel e.g., I got no error (but this may install newer than usual packages):
conda create --name r-reticulate -c conda-forge python=3.10 pandas numpy scipy matplotlib scikit-learn
If you want to keep the old conda
Install another environment from base with python 3.9 or older like
conda activate base
conda create --name r-reticulate python=3.9 pandas numpy scipy matplotlib sklearn
conda activate r-reticulate
Other symptoms
You basically cannot install anything after creating and activating your python 3.10 environment. You cannot even install conda-build:
conda install conda-build -y
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.
ResolvePackageNotFound:
- python=3.1
Conda 4.10 contains python 3.9 and conda 4.11 contains python 3.10, so your base environment should be compatible with the python version therein.
duplicate?
If you believe that your question is a duplicate, please check how you can improve it.
This answer is in agreement with meta. I believe this is an example where exactly the same answer should be accepted, but I also customized the answer to the question.
This works for me
library(reticulate)
x = import('pandas')
x$read_excel()
You can install the package in this way
py_install("pandas")

Solving environment: | Found conflicts! Looking for incompatible packages. The updating is eternal

I have Ubuntu 18.04.
I installed conda with python 2.7 some years ago. Finally I decided to pass to python 3.8
I create a new conda environment with python 3.8 and everything looked ok. When I tried to run a code by terminal, it printed:
ModuleNotFoundError: No module named 'numpy'
So I tip the command:
conda install numpy
and the terminal started an endless work. It printed:
Collecting package metadata (current_repodata.json): done
Solving environment: \
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
[...a series of link...]
failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
Later I report all the terminal output.
Now it is examining conflicts with every packages of conda and it is working by hours.
Somebody knows what has happened?
Why it is not simply installing the packages?
I have solved it.
I found another question with a similar situation:
Anaconda environments packages update
So I retry to install it using the pip line and it worked:
pip install numpy
I don't know why it doesn't work with the other way.

Having trouble installing PyQt5 using conda on Mac OS

I think its telling me it wants to use Python 3.7 but the message is confusing so I made 3.7 the default for the terminal shell, but I still get the following:
dzimmerman#QA-Bonjour-OSX ~ % python --version
Python 3.7.2
dzimmerman#QA-Bonjour-OSX ~ % conda install -c dsdale24 pyqt5
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.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- pyqt5 -> python=2.7
Your python: python=3.7
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
The pyqt5 package in the channel you are trying to use is compiled only for python 2.7.
You should use the version from conda-forge which also provides pyqt5 and has versions for pyhton 3.7 on OsX:
conda install -c conda-forge pyqt

Resources