接上一篇文章 ”conda,pip,git clone和源码安装“四种方式安装 python 包
四种 python package 安装方式
codna install package
pip install package
git clone
源码安装
以 python 包 annoy 为例:
方法一、codna install annoy
在 annaconda 中检索,annaconda 提供 annoy 包的安装,点开,会有安装代码
# 运行
conda install -c "conda-forge/label/gcc7" python-annoy
方法二、pip install annoy
pip install annoy
方法三、git clone
git clone https://github.com/spotify/annoy
cd annoy
pip install .
方法四、源码安装
PyPI https://pypi.org/ 搜索 annoy,下载源码包
wget https://files.pythonhosted.org/packages/ca/cf/ff4e0007cf66a0699d2222a3dbf7b66f187e4a8fd082306e220c560241fc/annoy-1.17.1.tar.gz
tar zxvf annoy-1.17.1.tar.gz
cd annoy-1.17.1.tar.gz
python setup.py -help # 检查环境配置
python setup.py install # 正式安装
本文介绍了四种安装Python包的方法:使用conda通过conda-forge安装annoy,使用pip直接安装annoy,从GitHub通过gitclone获取源码后用pip安装,以及从PyPI下载源码包后进行源码安装。每种方法都有详细的操作步骤。

被折叠的 条评论
为什么被折叠?



