your programing

pip와 conda의 차이점은 무엇입니까?

lovepro 2020. 10. 2. 22:58
반응형

pip와 conda의 차이점은 무엇입니까?


나는 pip파이썬 패키지의 패키지 관리자 라는 것을 알고 있습니다. 그러나 IPython 웹 사이트의 설치가 IPython conda을 설치 하는 사용 되는 것을 보았습니다 .

pipIPython을 설치 하는 사용할 수 있습니까 ? conda이미 가지고 있는데 다른 파이썬 패키지 관리자로 사용해야하는 이유는 무엇 pip입니까?

pip의 차이점은 무엇입니까 conda?


Conda 블로그 에서 인용 :

오랫동안 파이썬 세계에 참여해 왔기 때문에 우리는 모두 pip, easy_install 및 virtualenv를 알고 있지만 이러한 도구는 특정 요구 사항을 모두 충족하지 못했습니다. 주요 문제는 소스 코드에 setup.py가없고 Python 사이트에 파일을 설치하지 않는 HDF5, MKL, LLVM 등과 같은 비 Python 라이브러리 종속성을 무시하고 Python에 초점을 맞추고 있다는 것입니다. -packages 디렉토리.

그래서 Conda는 무엇보다 더 많은 일을하는 것을 목표로하는 패키징 도구이자 설치 프로그램입니다 pip. Python 패키지 및 Python 패키지 자체 외부라이브러리 종속성을 처리 합니다. Conda는 또한 가상 환경을 만듭니다 virtualenv.

따라서 Conda는 아마도 Python 및 비 Python 설치 작업을 모두 처리 할 수있는 또 다른 도구 인 Buildout 과 비교되어야 합니다.

Conda는 새로운 패키징 형식을 도입하기 때문에 Conda pip와 같은 의미로 사용할 수 없습니다 . pipConda 패키지 형식을 설치할 수 없습니다. pip와 함께 설치하여 두 도구를 나란히 사용할 수 conda install pip있지만 상호 운용되지는 않습니다.

이 답변을 작성한 이후 Anaconda는 Conda 및 Pip 이해대한 새 페이지를 게시했습니다 .

이것은 conda와 pip의 주요 차이점을 강조합니다. Pip은 Python 패키지를 설치하는 반면 conda는 모든 언어로 작성된 소프트웨어를 포함 할 수있는 패키지를 설치합니다. 예를 들어, pip를 사용하기 전에 시스템 패키지 관리자를 통해 또는 설치 프로그램을 다운로드하고 실행하여 Python 인터프리터를 설치해야합니다. 반면에 Conda는 Python 패키지와 Python 인터프리터를 직접 설치할 수 있습니다.

그리고 더

때때로 conda 패키지로 사용할 수 없지만 PyPI에서 사용할 수 있고 pip로 설치할 수있는 패키지가 필요합니다. 이 경우 conda와 pip를 모두 사용하는 것이 좋습니다.


다음은 간단한 요약입니다.

  • Python 패키지 만 해당됩니다.
  • 소스에서 모든 것을 컴파일합니다. 편집 : pip는 이제 사용 가능한 경우 이진 휠을 설치합니다.
  • 핵심 Python 커뮤니티의 축복을 받았습니다 (예 : Python 3.4+에는 pip를 자동으로 부스트하는 코드가 포함됨).

콘다

  • 파이썬에 구애받지 않습니다. 기존 패키지의 주요 초점은 Python을위한 것이며 실제로 conda 자체는 Python으로 작성되었지만 C 라이브러리, R 패키지 또는 실제로는 어떤 것이 든 conda 패키지를 가질 수도 있습니다.
  • 바이너리를 설치합니다. conda build소스에서 패키지를 빌드 하는 도구가 있지만 conda install자체적으로 이미 빌드 된 conda 패키지에서 항목을 설치합니다.
  • 외부. Conda는 Continuum Analytics에서 제공하는 Python 배포 인 Anaconda의 패키지 관리자이지만 Anaconda 외부에서도 사용할 수 있습니다. pip를 설치하여 기존 Python 설치와 함께 사용할 수 있습니다 (기존 설치를 사용할 합당한 이유가없는 한 권장되지 않음).

두 경우 모두 :

  • Python으로 작성
  • 오픈 소스 (conda는 BSD, pip는 MIT)

conda의 처음 두 가지 중요 사항은 실제로 많은 패키지에서 pip보다 유리한 점입니다. pip는 소스에서 설치되기 때문에 소스 코드를 컴파일 할 수없는 경우 함께 설치하는 것이 어려울 수 있습니다 (특히 Windows에서는 해당되지만 패키지에 어려운 C 또는 FORTRAN 라이브러리가있는 경우 Linux에서도 마찬가지 일 수 있음). 종속성). Conda는 바이너리에서 설치합니다. 즉, 누군가 (예 : Continuum)가 이미 패키지를 컴파일하는 어려운 작업을 수행 했으므로 설치가 쉽습니다.

자체 패키지를 빌드하는 데 관심이있는 경우에도 몇 가지 차이점이 있습니다. 예를 들어, pip는 setuptools 위에 빌드되는 반면 conda는 자체 형식을 사용하므로 몇 가지 장점이 있습니다 (예 : 정적 및 Python 불가지론).


다른 답변은 세부 사항에 대한 공정한 설명을 제공하지만 몇 가지 높은 수준의 요점을 강조하고 싶습니다.

pip는 Python 패키지 의 설치, 업그레이드 및 제거를 용이하게하는 패키지 관리자입니다 . 가상 파이썬 환경 에서도 작동 합니다.

conda는 모든 소프트웨어 (설치, 업그레이드 및 제거)를 위한 패키지 관리자입니다 . 또한 가상 시스템 환경 에서도 작동 합니다.

One of the goals with the design of conda is to facilitate package management for the entire software stack required by users, of which one or more python versions may only be a small part. This includes low-level libraries, such as linear algebra, compilers, such as mingw on Windows, editors, version control tools like Hg and Git, or whatever else requires distribution and management.

For version management, pip allows you to switch between and manage multiple python environments.

Conda allows you to switch between and manage multiple general purpose environments across which multiple other things can vary in version number, like C-libraries, or compilers, or test-suites, or database engines and so on.

Conda is not Windows-centric, but on Windows it is by far the superior solution currently available when complex scientific packages requiring compilation are required to be installed and managed.

I want to weep when I think of how much time I have lost trying to compile many of these packages via pip on Windows, or debug failed pip install sessions when compilation was required.

As a final point, Continuum Analytics also hosts (free) binstar.org (now called anaconda.org) to allow regular package developers to create their own custom (built!) software stacks that their package-users will be able to conda install from.


Not to confuse you further, but you can also use pip within your conda environment, which validates the general vs. python specific managers comments above.

conda install -n testenv pip
source activate testenv
pip <pip command>

you can also add pip to default packages of any environment so it is present each time so you don't have to follow the above snippet.


Quote from Conda for Data Science article onto continuum website:

Conda vs pip

Python programmers are probably familiar with pip to download packages from PyPI and manage their requirements. Although, both conda and pip are package managers, they are very different:

  • Pip is specific for Python packages and conda is language-agnostic, which means we can use conda to manage packages from any language Pip compiles from source and conda installs binaries, removing the burden of compilation
  • Conda creates language-agnostic environments natively whereas pip relies on virtualenv to manage only Python environments Though it is recommended to always use conda packages, conda also includes pip, so you don’t have to choose between the two. For example, to install a python package that does not have a conda package, but is available through pip, just run, for example:
conda install pip
pip install gensim

Quoting from Conda: Myths and Misconceptions (a comprehensive description):

...

Myth #3: Conda and pip are direct competitors

Reality: Conda and pip serve different purposes, and only directly compete in a small subset of tasks: namely installing Python packages in isolated environments.

Pip, which stands for Pip Installs Packages, is Python's officially-sanctioned package manager, and is most commonly used to install packages published on the Python Package Index (PyPI). Both pip and PyPI are governed and supported by the Python Packaging Authority (PyPA).

In short, pip is a general-purpose manager for Python packages; conda is a language-agnostic cross-platform environment manager. For the user, the most salient distinction is probably this: pip installs python packages within any environment; conda installs any package within conda environments. If all you are doing is installing Python packages within an isolated environment, conda and pip+virtualenv are mostly interchangeable, modulo some difference in dependency handling and package availability. By isolated environment I mean a conda-env or virtualenv, in which you can install packages without modifying your system Python installation.

Even setting aside Myth #2, if we focus on just installation of Python packages, conda and pip serve different audiences and different purposes. If you want to, say, manage Python packages within an existing system Python installation, conda can't help you: by design, it can only install packages within conda environments. If you want to, say, work with the many Python packages which rely on external dependencies (NumPy, SciPy, and Matplotlib are common examples), while tracking those dependencies in a meaningful way, pip can't help you: by design, it manages Python packages and only Python packages.

Conda and pip are not competitors, but rather tools focused on different groups of users and patterns of use.


For WINDOWS users

"standard" packaging tools situation is improving recently:

  • on pypi itself, there are now 48% of wheel packages as of sept. 11th 2015 (up from 38% in may 2015 , 24% in sept. 2014),

  • the wheel format is now supported out-of-the-box per latest python 2.7.9,

"standard"+"tweaks" packaging tools situation is improving also:

  • you can find nearly all scientific packages on wheel format at http://www.lfd.uci.edu/~gohlke/pythonlibs,

  • the mingwpy project may bring one day a 'compilation' package to windows users, allowing to install everything from source when needed.

"Conda" packaging remains better for the market it serves, and highlights areas where the "standard" should improve.

(also, the dependency specification multiple-effort, in standard wheel system and in conda system, or buildout, is not very pythonic, it would be nice if all these packaging 'core' techniques could converge, via a sort of PEP)


pip is for Python only

conda is only for Anaconda + other scientific packages like R dependencies etc. NOT everyone needs Anaconda that already comes with Python. Anaconda is mostly for those who do Machine learning/deep learning etc. Casual Python dev won't run Anaconda on his laptop.


Can I use pip to install iPython?

Sure, both (first approach on page)

pip install ipython

and (third approach, second is conda)

You can manually download IPython from GitHub or PyPI. To install one of these versions, unpack it and run the following from the top-level source directory using the Terminal:

pip install .

are officially recommended ways to install.

Why should I use conda as another python package manager when I already have pip?

As said here:

If you need a specific package, maybe only for one project, or if you need to share the project with someone else, conda seems more appropriate.

Conda surpasses pip in (YMMV)

  • projects that use non-python tools
  • sharing with colleagues
  • switching between versions
  • switching between projects with different library versions

What is the difference between pip and conda?

That is extensively answered by everyone else.


I may have found one further difference of a minor nature. I have my python environments under /usr rather than /home or whatever. In order to install to it, I would have to use sudo install pip. For me, the undesired side effect of sudo install pip was slightly different than what are widely reported elsewhere: after doing so, I had to run python with sudo in order to import any of the sudo-installed packages. I gave up on that and eventually found I could use sudo conda to install packages to an environment under /usr which then imported normally without needing sudo permission for python. I even used sudo conda to fix a broken pip rather than using sudo pip uninstall pip or sudo pip --upgrade install pip.


pip is a package manager.

conda is both a package manager and an environment maanger.

Detail:

enter image description here

References

참고URL : https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda

반응형