在max os x上安装brew和python3


brew的安装:

因为max os x上自带了ruby, 执行以下命令:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brer安装成功后,就可以用它用安装其它软件了;

python3的安装:

brew install python3

==> python
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python/libexec/bin

If you need Homebrew's Python 2.7 run
  brew install python@2

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python

安装成功了。

然后又可以用pip3命令来安装python的软件了。

什么是pip3:

Python之所以强大,其中一个原因是其丰富的第三方库。

pip则是python第三方库的包管理工具。 由于在Mac上python2和python3是共存的。

因而python3对应的包管理工具的命令就是:pip3。

例如安装you-get:

pip3 install you-get

Collecting you-get
  Downloading https://files.pythonhosted.org/packages/e6/3d/5da4f2271a8022da8ac41c5f520bbea3a08a9bee65938bae722a89b0f09d/you_get-0.4.1270-py3-none-any.whl (206kB)
    100% |████████████████████████████████| 215kB 130kB/s 
Installing collected packages: you-get
Successfully installed you-get-0.4.1270

 

智能推荐

注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告