갈루아의 반서재

728x90

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_NAMEpip 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_NAMEpip uninstall $PACKAGE_NAMEX
Create an environmentconda create --name $ENVIRONMENT_NAME pythonXcd $ENV_BASE_DIR; virtualenv $ENVIRONMENT_NAME
Activate an environmentsource activate $ENVIRONMENT_NAMEXsource $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.


728x90