《深入理解difference conda vs. pip || venv||virtualenv||pipenv||poetry》
env用于创建python 虚拟环境，两者都是建立在已有的python interpreter之后。
Condawas created for Python programs, but it can package and distribute software for any language.
If you need a package that requires a different version of Python, you do not need to switch to a different environment manager, because
condais also an environment manager.
conda packages is a compressed tarball file (
.condafile that contains:
- system-level libraries
- Python or other modules
- executable programs and other components
- metadata under the
- a collection of files that are installed directly into an
conda package specification
conda channels are the locations where packages are stored.
conda environments is a directory that contains a specific collection of conda packages that you have installed. You can easily activate or deactivate environments, which is how you switch between them. You can also share your environment with someone by giving them a copy of your
Conda vs. pip vs. virtualenv commands
conda info --envs # list all environments conda activate envName # search packages conda search <package> # list installed packages conda list --name $ENVIRONMENT_NAME conda env export > environment.yml conda remove --name myenv --all conda update python conda remove scipy
/opt/Anaconda # ROOT_DIR-the directory that Ananconda was installed into /opt/anaconda/pkgs # PKGS_DIR, decompressed packages, ready to be linked in conda environments /opt/anaconda/envs # additional conda environments to be created # the subdirectories comprise the default Anaconda environment /opt/anaconda/envs/name/bin /opt/anaconda/envs/name/include /opt/anaconda/envs/name/lib /opt/anaconda/envs/name/share
When you create a new environment, conda installs the same Python version you used when you downloaded and installed Anaconda. If you want to use a different version of Python, for example Python 3.5, simply create a new environment and specify the version of Python that you want.
conda create --name snakes python=3.6 conda activate snakes conda info --envs # verify that the snakes environment has beed added and is active python --version # verify which version of Python is in your current environment conda activate # deactivate the snakes and return to base environment conda search beautifulsoup4 # check is package avaiable from Anaconda repository conda install beautifulsoup4 conda list # check to see if the newly installed program is in this environment
The conda configuration file, .
condarc, is an optional runtime configuration file that allows advanced users to configure various aspects of conda.
The .condarc file is not included by default, but it is automatically created in your home directory the first time you run the