-
Conda vs Pip개발 2018. 11. 18. 22:22
특징
Pip
Conda
- Python 패키지 전용
- 코드 소스의 모든 것을 컴파일 가능(binary wheels도 설치 가능!)
- Python의 정식 지원을 많이 받는다. Python 3.4 이상은 pip을 자동으로 제공
- Python 제한적이지 않다. Python 패키지 관리를 위해 만들어졌고, conda 자체도 Python으로 만들어졌지만, C, R을 비롯한 다른 언어의 패키지도 관리가 가능하다.
- binary를 설치한다. conda build 코드를 이용해 소스코드로부터 패키지를 빌드할 수 있다.
- Anacoda를 위해 만들어진 것이지만 anaconda 밖에서도 사용 가능하다. Anaconda를 통하지 않고 설치된 Python에서도 pip install을 통해 conda를 설치하고, 사용 가능하다.
- sudo pip: install to root env
- install from PyPI
- PyPI: Python Package Index
- repository of software for Python
- install from Anaconda pkg
/anaconda/envs/env_name/lib/python3.5/site-packages/pkgname
conda install 모듈과 같은 경로에 설치됨
/anaconda/envs/env_name/lib/python3.5/site-packages/pkgname
pip install 모듈과 같은 경로에 설치됨
명령어 비교
Task
Conda
Pip
Install a package
conda install $PACKAGE_NAME
pip install $PACKAGE_NAME
Update a package
conda update --name $ENVIRONMENT_NAME$PACKAGE_NAME
pip install --upgrade $PACKAGE_NAME
Update package manager
conda update conda
Linux/OSX: pip install -U pip
Win: python -m pip install -U pip
Uninstall a package
conda remove --name $ENVIRONMENT_NAME$PACKAGE_NAME
pip uninstall $PACKAGE_NAME
Create an environment
conda create --name $ENVIRONMENT_NAME python
-
Activate an environment
source activate $ENVIRONMENT_NAME
-
Deactivate an environment
source deactivate
-
Search available packages
conda search $SEARCH_TERM
pip search $SEARCH_TERM
Install package from specific source
conda install --channel $URL $PACKAGE_NAME
pip install --index-url $URL $PACKAGE_NAME
List installed package
conda list --name $ENVIRONMENT_NAME
pip list
Create requirements file
conda list --explicit > filename
pip freeze > filename
List all environments
conda info --envs
-
Install other package manager
conda install pip
pip install conda
Install Python
conda install python=3.5
-
Update Python
conda update python *
-
Etc
Wheels: Wheels are the new standard of python distribution and are intended to replace eggs. Support is offered in pip >= 1.4 and setuptools >= 0.8
Advantages of wheels
- Faster installation for pure python and native C extension packages.
- Avoids arbitrary code execution for installation. (Avoids setup.py)
- Installation of a C extension does not require a compiler on Windows or OS X.
- Allows better caching for testing and continuous integration.
- Creates .pyc files as part of installation to ensure they match the python interpreter used.
- More consistent installs across platforms and machines.
참고자료
- http://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda
- https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/qvyWaeY9tjk
'개발' 카테고리의 다른 글
conda 가상환경 실행이 되지 않는 경우 (0) 2018.11.18 COMMUNITY POWERED CONDA PACKAGING: CONDA-FORGE (0) 2018.11.18 Conda virtual environment (0) 2018.11.18 anaconda 32, 64비트 전환 (0) 2018.11.18 Elasticsearch 실행: Permission denied 에러 (0) 2018.11.18 댓글