python – conda create env gives PackageNotFound error for not specified package

Trying to create a conda env with line conda create -n myenv python=3.9

I got this error, showing that it was trying to install a locally built package that I didn’t specify, let’s call it localpackage

Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - localpackage

Current channels:


To search for alternate channels that may provide the conda package you're
looking for, navigate to

and use the search bar at the top of the page

Found out that this was basically because this package was listed in my conda config,

  - localpackage

I removed this using
conda config --remove create_default_packages localpackage

and issue is fixed now!

Just sharing with the community!

Read more here: Source link