Tag Archives: Failed to Create New Environment Error

Failed to Create New Environment Error: Collecting package metadata (current_repodata.json): failed.

Recently, due to the need to set up a new environment for the GUI interface, an error occurred in the header line during the process of creating a new environment. 

The significance of creating a new environment
As each project requires different libraries and their versions, running the project in the root directory will be much more complicated, which is why many people will choose to use a virtual environment. That is, suppose you do project A with package versions PyQt5=’5.5.1′ and sklearn=’0.22.1′, and project B with package versions PyQt5=’5.6.1′ and sklearn=’0.23.1′, then you have to uninstall PyQt5 5.5.1 and sklearn0.22.1 and install PyQt5 5.6.1′ and sklearn0.23.1, but then you have to uninstall the previous package version to do something like project 1, so it’s a lot of trouble to go back and forth, so why not create virtual environment A with PyQt5 5.5.1 and sklearn0.22.1, virtual environment B with PyQt5 5.6.1′ and sklearn0.23.1, and do project A will use virtual environment A, and project B will use virtual environment B, which will not interfere with each other and improve the convenience a lot.

Question restatement:

If you have reinstalled anaconda, a file named .condarc will be automatically generated in the user directory on the C drive.
When using the commands conda install and conda create, the following problem occurs: Collecting package metadata (current_repodata.json): failed

First, a few words about the role of the .condarc file.

.condarc starts with a dot and generally indicates the configuration file for the conda application, in the user’s home directory (windows: C:\\users\\\username\\, linux: /home/username/).

For the .condarc configuration file, which is an optional (optional) runtime configuration file, this file is not available by default and is only created automatically after you have executed the conda config command. This file is the configuration file for conda in YAML format. For example, you can set the channel to install the package, whether to automatically update conda, whether to allow other channels, and other settings.

Solution:

1. Open Anaconda Prompt and enter the following command

conda config --show-sources

As shown in the figure, the running result is displayed that the .condarc file is in the C:\Users\DELL folder

2. Delete .condarc file

The problem was solved successfully!!!