简体   繁体   中英

Anaconda pre installed pip packages in new env

every time when I create a new conda env, I have pre-installed pip packages which I have installed in other env with the same python version. Is this right? I want to create a new env just with the necessary pip packages for a clean env.

I create a new env with:

conda create --name newenv python=3.8

Thats the same env on the picture, i tryed to uninstall and reinstall Anaconda navigator but the problem is still there.

Every time a conda env is created one can specify default packages, by adding create_default_packages on the .condarc file.

If you want to ignore these default packages and for example install only some desired packages

conda create --no-default-packages -n myenv python=3.8 pycaret pandas scipy

or if you want these packages as default every time you create an environment add

create_default_packages:
  - pip
  - pycaret
  - pandas
  - scipy

to your .condarc file.

A third option is to pass package requirements through an environment.yml file through the --f argument. From the docs

name: myenv
dependencies:
  - python=3.8   
  - pip
  - pycaret
  - pandas
  - scipy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM