원문URL → http://stuarteberg.github.io/conda-docs/_downloads/conda-pip-virtualenv-translator.html




conda vs. pip vs. virtualenv

If you’ve used pip and virtualenv in the past, you can use conda to perform all of the same operations. Pip is a package manager, and Virtualenv is an environment manager. Conda is both.



TaskConda package and environment manager commandPip package manager commandVirtualenv environment manager command
Install a packageconda install $PACKAGE_NAMEpip install $PACKAGE_NAMEX
Update a packageconda update --name$ENVIRONMENT_
NAME$PACKAGE_NAME
pip install --upgrade $PACKAGE_NAMEX
Update package managerconda update condaLinux/OSX: pip install -U pip Win: python -m pip install -U pipX
Uninstall a packageconda remove --name$ENVIRONMENT_
NAME$PACKAGE_NAME
pip uninstall $PACKAGE_NAMEX
Create an environmentconda create --name$ENVIRONMENT_
NAME python
Xcd $ENV_BASE_DIR; 
virtualenv$ENVIRONMENT_NAME
Activate an environmentsource 
activate$ENVIRONMENT_NAME
Xsource$ENV_BASE_DIR/
$ENVIRONMENT_NAME/bin/activate
Deactivate an environmentsource deactivateXdeactivate
Search available packagesconda search $SEARCH_TERMpip search $SEARCH_TERMX
Install package from specific sourceconda install --channel $URL$PACKAGE_NAMEpip install --index-url $URL$PACKAGE_NAMEX
List installed packagesconda list --name$ENVIRONMENT_NAMEpip listX
Create requirements fileconda list --exportpip freezeX
List all environmentsconda info --envsXInstall virtualenv wrapper, then lsvirtualenv
Install other package managerconda install pippip install condaX
Install Pythonconda install python=x.xXX
Update Pythonconda update python *XX


  • conda update python updates to the most recent in the series, so Python 2 to latest 2.x, Python 3 to latest 3.x, and so on.








반응형

+ Recent posts