I have been trying to update spacy to the new version in conda environment. I have not been successful though I have used the below command conda update spacy=3.0
and
(base) hadi#notebook:~$ conda install -c conda-forge spacy=3.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
I had almost exactly the same problem, but I was using PyCall in Julia.
The solution for me was to remove spacy, clean conda and then manually add conda-forge as a channel and then reinstall spacy.
conda remove spacy
conda clean
conda config --add channels conda-forge
conda install spacy
explicitly adding the channel may be what actually fixed the problem, but I am not sure.
thanks. I got answer issue was spacy has not released version 3 for conda.
Related
I have tried to install new package in conda for windows using the following command:
conda install -c conda-forge python-pdfkit
but got the following error:
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.
I have tried the following workarounds but no use, still getting the same error:
Workaround 1:
$conda create --name myenv
$conda activate myenv
Workaround 2:
conda config --set ssl_verify false
I have had a similar issue before and since I don't see your code I can't specify exactly what the solution is. All I know is that while installing conda package the following issues might occur:
The package you are trying to install is not available in the conda-forge channel. In this case, you may need to try installing the package from a different channel, or you may need to specify a different channel in the conda install command.
The package you are trying to install is not compatible with your current version of conda or with the other packages you have installed. In this case, you may need to try updating your version of conda or try installing a different version of the package.
There is a problem with your conda configuration or with the conda environment you are using. In this case, you may need to try creating a new conda environment and installing the package there, or you may need to try re-installing conda itself.
If you are still having trouble installing the package after trying the above methods, Please give me more details about your specific situation, such as the version of conda you are using and the other packages you have installed. This will help me know more about your issue to be able to offer more specific suggestions.
Hope this will help somehow.
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")
I am trying to install the geopandas package with Anaconda Prompt, but after I use conda install geopandas an unexpected thing happened:
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
After this, it proceeds to search for conflicts, but hours pass without finishing. In the end, I still cannot use geopandas.
I have also tried installing geopandas in a different virtual environment and it works but I do not know how to use the environment in Jupyter Notebooks.
I would like to know, how can install geopandas without a separate environment?
Or, alternatively, how can I use geopandas in Jupyter Notebooks after install it in a separate environment?
Install it in a new env, and include ipykernel if you plan to use it in Jupyter:
conda create -n my_env geopandas ipykernel
Note, nb_conda_kernels should be installed install in your base env (i.e. where you launch Jupyter from). This enables Jupyter to automatically recognize other envs that are kernel-ready:
conda install -n base nb_conda_kernels
in my case, I installed geos firstly: pip install geos, then conda install geopandas and everything went through.
If you want to install geopandas in an EXISTING environment, use conda-forge as follows:
conda install --channel conda-forge geopandas
I faced the same problem. As far as I understand, my mistake was to install geopandas or pyproj with pip instead of conda. When trying to fix the issue (uninstalling geopandas, pyproj) I completely crashed my env.
I fixed the issue by completely reinstalling anaconda and creating a new separate conda env with an older version of python (python=3.8 instead of 3.9). Then everything ran smoothly.
I had this issue when Jupyter had been installed from the default channel. For me running conda uninstall jupter followed by conda install -c conda-forge geopandas worked.
You can install geopandas with pip, however, geopandas requires other dependencies (such as pandas, fiona, shapely, pyproj, rtree). You need to make sure that they are properly installed. After that you should be able to use them in jupyter with a simple import geopandas.
I'm using requirements.txt to manage my python dependency:
six
tqdm
future
numpy
brine
scipy
matplotlib
# birdseye
shapely
git+https://github.com/tribbloid/jupyerlab-desktop.git#subdirectory=python
jupytext
# pyre-check
# deprecated
torch >= 1.2.0
# tensorboard
# opencv >= 4.0.0
# prototypes
git+https://github.com/pytorch/vision.git#v0.4.0#egg=torchvision
tb-nightly
My environment is a conda env on python 3.7. I was trying to use a few command to install these packages, but when I run:
conda install --file requirements.txt
I got the following error message:
$ conda install --file ./requirements.txt
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:
- tb-nightly
- //github.com/tribbloid/jupyerlab-desktop.git
- torch[version='>=1.2.0']
- //github.com/pytorch/vision.git#v0.4.0
- brine
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.
It appears that conda refuse to install any of them simply because it can't find 3 packages! (they are on PyPI) What's the point of this design and what should I do to fix it?
My end goal is to use conda if possible, and fallback to pip if they are only on PyPI, the entire process should be reproducible and fully automated.
You can delete offending packages from requirements.txt, run conda on the new .txt, then install non-installed packages via pip into your Anaconda/pkgs (or move them there manually post-install). Then, run conda update --all to ensure compatibility.
Worked for me for a similar instance.
This works on Linux. Just install via pip in your conda environment, it won't complain about not finding the packages like conda.
Run pip install -r requirements.txt. This will install the packages in your conda environment plus all their dependencies.
Make sure to activate your environment and that you are running this command in the directory where your requirements.txt is i.e in terminal cd to wherever requirements.txt is.
I thought to try only after installing keras and tensorflow via pip so I can't say 100% that it would've worked for those as well, but everything else in my req file (+50 modules) installed with this command on Win11 in Anaconda Powershell while in the active environment.
conda install -c conda-forge --file requirements.txt
I still don't know why I needed to do this. Also, I tried another req file that I didn't have a problem with weeks prior. It also failed as the OP states. I don't know what I may have done (not done) to cause this. Perhaps missing a conda update or server down.
I am using anaconda as below:
(base) C:\Users\xxx>conda info
active environment : base
active env location : C:\Users\xxx\Documents\ANACONDA
shell level : 1
user config file : C:\Users\xxx\.condarc
populated config files : C:\Users\xxx\.condarc
conda version : 4.7.11
conda-build version : 3.18.9
python version : 3.6.9.final.0
virtual packages :
base environment : C:\Users\xxx\Documents\ANACONDA (writable)
channel URLs : 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/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\xxx\Documents\ANACONDA\pkgs
C:\Users\xxx\.conda\pkgs
C:\Users\xxx\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\xxx\Documents\ANACONDA\envs
C:\Users\xxx\.conda\envs
C:\Users\xxx\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.7.11 requests/2.22.0 CPython/3.6.9 Windows/10 Windows/10.0.16299
administrator : False
netrc file : None
offline mode : False
Now I have 2 issues that stop my work.
1) I cannot use conda install for any package.
It will give me the error in solving environment list this:
failed with initial frozen solve. Retrying with flexible solve.
then it will fail again and give message like this:
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
Even after the checking for incompatible packages, it didn't give me the solution.
2) When I want to upgrade or downgrade conda by the command:
conda update -n base conda
or
conda install conda = 4.6.11
It will give me errors again in the solving environment, and I think this is related to the first issue.
Now I cannot use conda for anything, please advise and thank you!
I ran into the same problem and I couldn't find a solution, but I did find a workaround. If you create an env and activate that env and then do the install, it seems to work just fine. If you don't need a lot of libraries I would try that.
Commands are:
Create env
conda create --name myenv
Activate the env
conda activate myenv
I started running in to this problem when one package suggested following modifications before installation
conda config --set channel_priority true
so I just reverted it and voila error's gone
conda config --set channel_priority false
I solved a similar problem by doing the following:
conda update --all --yes
You may downgrade to an older version of conda 4.6.14 and then install your packages.
conda config --set allow_conda_downgrades true
conda install conda=4.6.14
If your conda version is greater than or equal to 4.8, you may see that error.
(base) [localhost ~]$ conda --version
conda 4.8.2
(base) [localhost ~]$ conda install -c anaconda requests-kerberos
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.
Downgrade your conda if possible using the following commands
conda config --set allow_conda_downgrades true
conda install conda=4.6.14
Then create your virtual environment:
conda create --name myenv_conda
Then activate your myenv_conda
conda activate myenv_conda
Now try to install packages using conda -c install anaconda
eg: conda install -c conda requests-kerberos
output:
(myenv_conda) [localhost ~]$ conda install -c anaconda requests-kerberos
Collecting package metadata: done
Solving environment: done
....
....
....
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
https://stackoverflow.com/a/61117831/7802476 helped me. Creating a new environment using the accepted answer didn't get my jupyter notebook to recognize the installed opencv. I could only import cv2 when I was in the environment on my terminal.
The fix was to use pip instead of conda, pip install opencv-python
I run into same problem while installing geopandas. The issue was gone after I upgraded to a newer version of Anaconda using:
conda update --prefix C:\apps\anaconda3 anaconda
Note: you'll have to modify the path C:\apps\anaconda3 pointing to your own installation directory.
Strangely, I did download Anaconda from the official homepage just a few hours ago and thought I had the newest version...
I had same problem but I solved because of SKİD.
After you create new env, You can run one of the codes in this link.
https://anaconda.org/rdkit/rdkit
I've generally had good results with conda and pip, but learned over time that environments really can get broken by unusual combinations of packages, and just starting a new env from scratch is often the only way forward. In my case it was tensorflow-gpu that wouldn't install from conda-forge, into an env I'd already been using for some weeks. The list of packages cited as being incompatible was in the dozens. I tried all the things listed on this page, but in the end I just hammered out a new env. Since I was deducing what packages I needed to install in the new env by running my program and installing one package at each error (ie instead of being methodical about listing my former env), along the way I reproduced this frozen solve thing several times. Each time it happened, I shuffled that conda package back to the initial conda create command and started again. Eventually my program ran in the new env, with tensorflow-gpu imported, and the root cause was revealed as conda installs which occur after pip installs. It wasn't anything to do with conda version or conda config.
A specific note for anyone using opencv-python, I ended up needing to install qt via conda, before attempting to install opencv-python via pip. That was a tricky one because it's a runtime error, and on stack overflow many of the solutions refer to various qt lib requirements which aren't part of python/conda and which I already had.
A further specific note. Some pip installs will roll back a version of a related package, thus breaking other conda-installed packages. In my case the example was a package called peakutils rolling back numpy, which then broke a from numpy import ma in scale.py module in the matplotlib package. My head is still spinning.
Create a new environment if your are not superuser, after that activate environment to install packages
Recommend to upgrade conda latest version.
conda install --quiet --yes conda=4.7.11
python -m pip install --upgrade pip==19.2.2