简体   繁体   English

apt-get install python文件还是只是pip install?

[英]apt-get install python files or just pip install?

I noticed that i was reading a book mentioning to install numpy and opencv by way of apt-get 我注意到我正在读一本书,提到通过apt-get安装numpy和opencv

apt-get install python-numpy python-opencv

but i can find these in pip by: 但我可以通过以下方式找到这些:

pip search numpy

so this begs me to ask the question: 所以这让我问这个问题:

How do these package managers work? 这些包管理器如何工作? If i run pip install numpy will it install to the same directory as apt-get install python-numpy ? 如果我运行pip install numpy它会安装到apt-get install python-numpy吗?

I was curious as to what the best way to do it would be if they are installed into different paths. 我很好奇如果将它们安装到不同的路径中,最好的方法是什么。

I want to say "just do it in pip" but its hard to justify since I dont know how each of the different package managers install things. 我想说“只是在点子里做”但很难证明,因为我不知道每个不同的包管理器是如何安装的。 Are they installed into different directories, but both are on the path to accessible python modules? 它们是否安装在不同的目录中,但两者都在可访问的python模块的路径上?

pip will work on a larger variety of stock systems/OS's, as opposed to apt-get which typically applies to Linux flavors. pip将适用于更多种类的库存系统/操作系统,而apt-get通常适用于Linux风格。 For example, apt-get is not available on OS X. You can use Homebrew to get it, but pip was the easiest way for me to install OpenCV. 例如, apt-get在OS X上不可用。您可以使用Homebrew来获取它,但是pip是我安装OpenCV的最简单方法。 Check https://pypi.python.org/pypi/opencv-python/3.2.0.7 out. 检查https://pypi.python.org/pypi/opencv-python/3.2.0.7 Anything in PyPI should be easier to install. PyPI中的任何内容都应该更容易安装。

对我来说,最好的位置可以在https://notes.pault.ag/debian-python/找到:如果系统需要一些东西,请使用apt-get(dpkg),如果某些东西不适用于系统(可能是开发) ,使用pip(并且永远不要使用sudo以避免冒险破坏系统)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM