CondaHTTPError: HTTP 404 NOT FOUND for url <https://repo.anaconda.com/pkgs/main/noarch/repodata.json.bz2 - anaconda

I use Mac machine to create a virtual environment for Python
conda create -n test_python3_9 python=3.9
and received these errors:
Solving environment: failed
CondaHTTPError: HTTP 404 NOT FOUND for url <https://repo.anaconda.com/pkgs/main/noarch/repodata.json.bz2>
Elapsed: 00:00.022309
CF-RAY: 73e768d0bbde964b-SJC
The remote server could not find the noarch directory for the
requested channel with url: https://repo.anaconda.com/pkgs/main
As of conda 4.3, a valid channel must contain a `noarch/repodata.json` and
associated `noarch/repodata.json.bz2` file, even if `noarch/repodata.json` is
empty. please request that the channel administrator create
`noarch/repodata.json` and associated `noarch/repodata.json.bz2` files.
$ mkdir noarch
$ echo '{}' > noarch/repodata.json
$ bzip2 -k noarch/repodata.json
You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state.
Further configuration help can be found at <https://conda.io/docs/config.html>.
conda version is conda 4.5.12
and the .condarc file content is:
ssl_verify: true
channels:
- defaults
mac version is: Catalina 10.15.7
Do not know how to fix this issue.
Can anyone helps on this?
Thanks,
Arthur

The file repodata.json.bz2 was uploaded to the repository https://repo.anaconda.com/pkgs/main/noarch at 2022-08-22 13:19:29 +0000. For now no need to update anaconda packages.

I've been struggling with exactly the same problem just few hours ago.
I had tried to change the conda channel(related to the repository) info in the conda configuration file, but it didn't work.
So I Just uninstalled the Anaconda and install the latest version of conda, it works.
If you visit the url 'https://repo.anaconda.com/pkgs/main/noarch' in the errors,
you can see that there is no 'noarch/repodata.json.bz2' file. I think this is the cause of the problem. Old conda version requires that file, but the conda repository does not support it anymore.

Related

CondaValueError: Malformed version string '~': invalid character(s)

I'm getting a Malformed version string error with my conda. I have no idea how to debug this or how to check it.
Can anyone help? GitHub has talked about the issue but I haven't seen any fixes.
-bash-4.1$ conda install -c bioconda pysam
Solving environment: failed
1. CondaValueError: Malformed version string '~': invalid character(s).
In response to the comment below:
(mage_env) -bash-4.1$ echo $PATH
/usr/local/devel/ANNOTATION/jespinoz/anaconda/envs/mage_env/bin:/usr/local/packages/jdk-8u121/bin/:/usr/local/bin:/usr/local/devel/ANNOTATION/rrichter/local/bin:/home/syooseph/utils/clustalw1.83:/usr/local/packages/gsl/bin:/usr/local/sge_current/bin/lx-amd64:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/devel/ANNOTATION/jespinoz/anaconda/bin:/usr/local/devel/ANNOTATION/jespinoz/Dropseq/:/usr/local/devel/ANNOTATION/jespinoz/Dropseq/Drop-seq_tools-1.13/
(mage_env) -bash-4.1$ conda info
active environment : mage_env
active env location : /usr/local/devel/ANNOTATION/jespinoz/anaconda/envs/mage_env
shell level : 1
user config file : /home/jespinoz/.condarc
populated config files : /home/jespinoz/.condarc
conda version : 4.5.11
conda-build version : not installed
python version : 3.6.2.final.0
base environment : /usr/local/devel/ANNOTATION/jespinoz/anaconda (writable)
channel URLs : https://conda.anaconda.org/ursky/linux-64
https://conda.anaconda.org/ursky/noarch
https://conda.anaconda.org/bioconda/linux-64
https://conda.anaconda.org/bioconda/noarch
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/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
package cache : /usr/local/devel/ANNOTATION/jespinoz/anaconda/pkgs
/home/jespinoz/.conda/pkgs
envs directories : /usr/local/devel/ANNOTATION/jespinoz/anaconda/envs
/home/jespinoz/.conda/envs
platform : linux-64
user-agent : conda/4.5.11 requests/2.14.2 CPython/3.6.2 Linux/2.6.32-696.18.7.el6.x86_64 centos/6.4 glibc/2.12
UID:GID : 3456:63
netrc file : None
offline mode : False
This looks like it was fixed with Conda 4.6.0. Upgrading your Conda should resolve the issue.
conda upgrade -n base conda
If you have trouble solving environment, I suggest trying
conda upgrade -n base -c defaults --override-channels conda
This will exclude all other channels during the solving process, and helps because having too many options to prune is one of the main reasons for slow solves.
I needed to remove conda-forge from my .condarc file. Then everything worked fine.
Had the same issue with conda 4.8.2 while I tried to create an environment from a yaml file.
loading a different, already existing environment and unloading it again did the trick in multiple occasions.
I got this error also when trying to install a package to a personal directory on an HPC, as in:
$ conda install -c dranew shapeit
Solving environment: failed
CondaValueError: Malformed version string '~': invalid character(s).
As a user of the HPC I'm not in control of the version of conda installed so had to find another solution.
This ended up working:
$ conda create --name shapeit -c dranew shapeit
or in generic terms,
$ conda create --name <packagename> -c <conda_channel_name> <packagename>
This tells conda to create an environment named packagename, then find the package in its channel (dranew for shapeit, bioconda for OP) and install it in that new environment.
I don't know if it makes a difference, but I ran this code when inside my .conda/envs directory.
Hope this helps someone else!
I had the similar problem
conda upgrade -n base conda
did pull the latest version but did not make the upgrade as I did not clear my previous install properly before installing latest anaconda.
Removing /root/anaconda3 ( default installation folder in my case ) &
removing /root/.conda & reinstalling the latest anaconda
Post that
conda upgrade -n base conda
would help you upgrade to 4.16+ version ( as of today, its latest )
One Additional Step which one must follow if they are importing env from one machine to this one:
remove specific version from conda package dependency, example here:
https://gitlab.com/mkuhring/TaxIt/-/commit/a8587e41bfff4c3362556c1c46d23d99ac3af069

The environment is inconsistent, please check the package plan carefully

I tried to update or install new packages from anaconda and lately, this message has appeared:
The environment is inconsistent, please check the package plan carefully
The following package are causing the inconsistency:
- defaults/win-32::anaconda==5.3.1=py37_0
done
I tried with conda clean --all and then conda update --all but it persists.
Conda Info
active environment : base
active env location : C:\Users\NAME\Continuum
shell level : 1
user config file : C:\Users\NAME\.condarc
populated config files : C:\Users\NAME\.condarc
conda version : 4.6.11
conda-build version : 3.17.7
python version : 3.7.3.final.0
base environment : C:\Users\NAME\Continuum (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/win-32
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/win-32
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/win-32
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-32
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\NAME\Continuum\pkgs
C:\Users\NAME\.conda\pkgs
C:\Users\NAME\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\NAME\Continuum\envs
C:\Users\NAME\.conda\envs
C:\Users\NAME\AppData\Local\conda\conda\envs
platform : win-32
user-agent : conda/4.6.11 requests/2.21.0 CPython/3.7.3 Windows/10 Windows/10.0.17763
administrator : False
netrc file : None
offline mode : False
I had faced the same problem. Simply running
conda install anaconda
solved the problem for me.
saw this on Google Groups
This message was added in conda 4.6.9, previously there was no indication when conda detected an inconsistent environment unless conda was run in debug mode. It is likely that your environment was inconsistent for some time but the upgrade to conda made it visible. The best option it to run "conda install package_name" for the inconsistent packages to let conda try to restore consistency.
and it really works for me.
Maybe you should try conda install anaconda in your situation.
The inconsistencies are caused due to different versions of the packages, and their clashing dependencies.
conda update --all
This command updates all the packages, and then conda solves the inconsistency on its own.
Had this same problem and none of the other solutions worked for me. Ended up having to uninstall and reinstall conda, then reinstall all of my libraries.
Ultimate solutions:
conda activate base
conda install anaconda
conda update --all
Works on Windows 10 and Ubuntu 18.04 (credits to #MF.OX for ubuntu).
Removed following problems for me:
The environment is inconsistent
WARNING conda.base.context:use_only_tar_bz2(632)
If the other solutions don't work, reverting the environment can fix this.
Use conda list --revisions, pick a revision number, and use conda install --revision [#] going back step-by-step until everything works again.
Given a situation like the following,
> conda update -c intel --all
Collecting package metadata: done
Solving environment: |
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
- intel/win-64::ipython==6.3.1=py36_3
- intel/win-64::prompt_toolkit==1.0.15=py36_2
done
As mentioned in other answers, the idea is to have some sort of re-installation to occur for the inconsistent packages.
Thus, with a few copy-&-paste's, you could:
> conda install intel/win-64::ipython==6.3.1=py36_3
Collecting package metadata: done
Solving environment: /
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:
- intel/win-64::ipython==6.3.1=py36_3
- intel/win-64::prompt_toolkit==1.0.15=py36_2
done
## Package Plan ##
environment location: c:\conda
added / updated specs:
- ipython
The following NEW packages will be INSTALLED:
jedi intel/win-64::jedi-0.12.0-py36_2
parso intel/win-64::parso-0.2.0-py36_2
pygments intel/win-64::pygments-2.2.0-py36_5
wcwidth intel/win-64::wcwidth-0.1.7-py36_6
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(and you would have to repeat for all the packages)
My “Shortcut”
Alternatively, cook up an (ugly) one-liner (this should work for Windows as well as other platforms)
Note: by "ORIGINAL_COMMAND", I'm referring to any command that gives you the error message (without any other side-effects, ideally)
<ORIGINAL_COMMAND> 2>&1 | python -c "import sys,re,conda.cli; conda.cli.main('conda','install','-y',*re.findall(r'^\s*-\s*(\S+)$',sys.stdin.read(),re.MULTILINE))"
Expanding the above one-liner:
from re import findall, MULTILINE
from sys import stdin
from conda.cli import main
main(
"conda", "install", "-y",
"--force", # Maybe add a '--force'/'--force-reinstall' (I didn't add it for the one-liner above)
*findall(r"^\s*-\s*(\S+)$", stdin.read(), MULTILINE) # Here are the offenders
)
I was getting an environment is inconsistent error when I tried to update my base conda environment. I'm using miniconda. Unfortunately, none of the answers above worked for me.
What did work for me was:
conda activate base
conda install conda --force-reinstall
conda install conda --force-reinstall
conda update --all
(Yes, for some reason it was necessary to run conda install conda --force-reinstall twice!)
The command conda install -c anaconda anaconda did the trick for me. For my setup, I need to specify the channel otherwise it would not work. After running the command in the terminal, I was prompted to update a list of packages that was found to be inconsistent. Without this step, I was not able to install or update any packages with conda install <package_name> or conda update <package_name respectively.
What worked for me was to
`conda remove <offending_packagename>`,
`conda update --all`
and then finally
`conda install <offending_packagename>`.
I had this problem for ages. The conda install anaconda might work, but it takes just way too long -- more than 24 hours on my machine.
Here is a solution that worked for me in under 5 minutes:
Remove all the unneeded packages -- being careful to leave the ones that are essential for conda to operate.
Then, use conda install anaconda.
But how?? there is a lot of them!
This is what I have done:
Make a fresh envinroment with python, fairly bare-bone. then, list the packages in there:
conda create -n fresh python
conda activate fresh
conda list
Save the output, you will need it.
1b. go back to the base envinroment:
conda deactivate
use the following snippet to generate a conda command that will remove all the inconsistent packages:
(good packages are)
exclusion_text = '''
_libgcc_mutex 0.1 main
_openmp_mutex 4.5 1_gnu
anyio 2.2.0 py39h06a4308_1
argon2-cffi 20.1.0 py39h27cfd23_1
async_generator 1.10 pyhd3eb1b0_0
...
... and more! get this from a good environment.
Note the usage of triple quotes (''') to use a multiline-string in python.
bad_packages_text = '''
- https://repo.continuum.io/pkgs/main/linux-64/networkx-2.1-py36_0.tar.bz2/linux-64::networkx==2.1=py36_0
- https://repo.continuum.io/pkgs/main/linux-64/spyder-3.2.6-> py36_0.tar.bz2/linux-64::spyder==3.2.6=py36_0
py36h4c697fb_0.tar.bz2/linux-64::jdcal==1.3=py36h4c697fb_0
- defaults/noarch::jupyterlab_server==1.1.4=py_0
- defaults/linux-64::argh==0.26.2=py37_0
...
... and more! get this by copy-pasting the "The following packages are causing the inconsistency." message.
then, in python, process this:
exclusions = [line.split(' ')[0] for line in exclusion_text_lines if line !='']
bad_packages_lines = bad_packages_text.split('\n')
bad_packages = [line.split('::')[1].split('==')[0] for line in bad_packages_lines if line!='']
exclusions.append('conda') # make sure!
exclusions.append('tqdm')
finally, construct the life-saving command:
command_line = 'conda remove '
for bad_package in bad_packages:
if bad_package not in exclusions:
command_line = f'{command_line} {bad_package}'
command_line
Since in solving the environment, all the packages on the remove list can be ignored, conda no longer needs to consider their versions, and the process is fast.
Possibly someone can refactor this method to make it easier -- or better yet, upgrade conda to enable quick reset base command.
This worked for me -- it took me longer to write this post than to execute these actions.
Good luck!
To those of us who have miniconda and can't/don't want to install anaconda: the accepted answer works when adapted.
conda install conda
conda update --all
Would have commented, but my rep is too low.
conda install anaconda
conda clean --all
conda update --all
fix the problem for me
To solve this message I had to run conda update --all in my base environment three times after each other.
Every time the number of inconsistent packages decreased until conda said:
# All requested packages already installed.
I'm on macOS Big Sur 11.6 using conda version 4.10.3.
In my case, none of the above worked. But this did the trick in less than a minute:
1- I downloaded again the lastest installer (miniconda in my case)
2- Run the installer with the -u option:
bash Miniconda3-py39_xxxx-Linux-x86_64.sh -u
3- Answer yes to all questions and let the installer finish
4- Then I could run conda update conda -all
Hope this helps...
You probably installed anaconda with python 2.7 but later you used python 3.x. Thus, you are getting an error message. In my case, I solved the problem by activating anaconda with python 2.7:
conda create --name py2 python=2.7
Try to have a look to the environment management
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
By using something along the lines
conda create --name astra python=3.5
conda activate astra
conda install -c astra-toolbox astra-toolbox
You can see that you can even specify target python version. Now play with the new packages installed. When unsatisfied, you can always do
conda deactivate
conda env remove -n astra
If you install everything to the base env and something gets broken, then probably better is not to install conda at all and go with default python managing it through pip.
In my environment.
1.
conda install anaconda
conda update --all
Then it works correctly.

"conda install pandas-datareader" not working

I am trying to install pandas_datareader in Anaconda prompt by running the following command as per the official documentation:
conda install -c anaconda pandas-datareader
I am getting the error - "Solving environment : Failed" as shown below
I am connected to internet.
I found some links which said I needed to downgrade my Conda AND Python versions, so I tried that too, but it again says "Solving environment : Failed"
Also tried running the following command in Anaconda prompt,
pip install pandas_datareader
and it gave the error:
Could not find a version that satisfies the requirement pandas_datareader (from versions: )
No matching distribution found for pandas_datareader
Can someone please help here?
Config Details
Conda version : 4.5.12
Python version : 3.7
OS : Windows 10
PyPI Installation
The correct line for installing with PyPI is
pip install pandas-datareader
Note that the package name uses a hyphen (pandas-datareader), which is different from the underscore (pandas_datareader) that is used when importing.
Conda Installation
It's hard to answer this outright without more information. Other Windows 10 users who are behind proxies have reported the same error on Issue #764, which includes potential solutions.
Changing Python Version? No
I am skeptical that you would need to downgrade Python. You can easily test whether this is true without having to actually do it. Namely, if you really did need to change your Python version, then the following command would correctly solve the environment:
conda create --dry-run -n test-pd-dr anaconda::pandas-datareader
whereas this one would fail:
conda create --dry-run -n test-pd-dr python=3.7 anaconda::pandas-datareader
I expect they'd both fail. The first one attempts to create any environment with the only constraint being that it include pandas-datareader, whereas the second one additionally adds the constraint to use the same Python minor version you report. If they both fail, it's something else.
Also, changing Python versions is base env is risky (it can break your Conda if done incorrectly) and requires following specific directions from Anaconda.
Use the following command in Conda Prompt:
conda install -c anaconda pandas-datareader

Conda hangs in "solving environment" when installing STSci packages

I run Ubuntu 18.04.1 LTS on a virtual machine on Windows 10. I've installed Anaconda 5.3 without any issues, but when I try to install an STSCI environment with the command line:
conda create -n astroconda stsci
the terminal gets stuck in "Solving Environment" (I have version 4.5.11 of conda). Yesterday I waited for about 4 hours before giving up. I would like to know if there is a known issue about this problem and if it can be related to the quantity of disk and RAM assigned to the virtual machine.
I will write a more general solution, to Conda's "Solving Environment" issue, which I had the uttermost pleasure with.
Short answer of things to try:
As already mentioned try updating Conda with conda update conda or even better, the whole base environment conda update --all.
Specify package and build version using <package>=<version>=<build> e.g. sage=8.3=py27_3. Search available versions by conda search <package>.
Like for the package, you can also specify python version and ideally some other dependencies. Check dependencies with conda info <package>.
Check current configuration inside the .condarc file or with conda config --get and check if you maybe have additional restrictions, as normally you will only find the channels defined there.
When working with additional channels put conda-forge or the channel you want to use on top and add channel_priority: strict. So your .condarc file would look like this:
channel_priority: strict
channels:
- conda-forge
- defaults
Contrariwise to the above, remove the first line and try adding --no-channel-priority to the command. This one helped me a couple times since updating to Conda 4.6.
If above does not work:
When conda seem stuck it is possibly having too many options or some conflicts resulting in the SAT solver getting clause counts of multiple millions.
To check if this is the case add -vv or --debug and you will later see lines like Invoking SAT with clause count: XXX. If it stays at one of these lines for long time, then try specifying version for packages as above. If there seem another issue, try the conda GitHub.
Another useful tip if you are using the conda-forge channel, is to go over their Tips & tricks.
I have the same problem on macOS 10.13.6.
The creation of iraf environment
conda create -n iraf27 python=2.7 iraf-all pyraf-all stsci
works fine instead.
Update: I found out that specifying the python version
conda create -n astroconda python=3.6 stsci
makes the installer work also with astroconda.
I had the same issue but then I updated Conda and it worked...
$ conda update conda

Conda Pytorch on Windows results in HTTP Connection Error

In general, my package manager and connection work fine. I just ran a conda update --all command that worked and updated all of my packages. However, when I run conda install -c pytorch pytorch as specified on anaconda's website https://anaconda.org/pytorch/pytorch it results in the following error.
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/win-64/pytorch-0.4.0-py36_cuda80_cudnn7he774522_1.tar.bz2>
Elapsed: -An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way.
I was curious if anyone else is experiencing this problem, as you may notice the pytorch upload for windows was only made on conda 3 days ago. Otherwise, if someone has a fix that will be compatible with conda, your input is appreciated.
UPDATE [SOLUTION]: I went to work and found an additional conda upload command for pytorch has been recently updated for windows. That is conda install -c soumith pytorch as specified https://anaconda.org/soumith/pytorch
I found this command to work on both my home and work laptops.

Resources