ACI安装python SDK

安装ACI SDK之前需要准备

Python 2.7,easy_install,pip,virtualenv,SDK包

virtualenv这个玩意不是必须的,但是ACI版本一直在升级,不同版本的SDK不一样,这个比较烦

SDK包直接在APIC上下载,

https://x.x.x.x/cobra/_downloads/ 

包括类似acicobra-1.1_1j-py2.7.egg, acimodel-1.1_1j-py2.7.egg这两个文件,我这里是1.3.2

我这里virtualenv在D:\python\aci\这个目录下面 通过dir可以看到文件

D:\python\aci\Scripts>dir
2017/03/05  16:11    <DIR>          .
2017/03/05  16:11    <DIR>          ..
2017/03/05  16:02            90,360 acicobra-1.3_2h-py2.7.egg
2017/03/05  16:08        69,542,066 acimodel-1.3_2h-py2.7.egg
2017/03/05  15:30             2,283 activate
2017/03/05  15:30               543 activate.bat
2017/03/05  15:30             8,325 activate.ps1
2017/03/05  15:30             1,137 activate_this.py
2017/03/05  15:30               348 deactivate.bat
2017/03/05  15:30            92,018 easy_install-2.7.exe
2017/03/05  15:30            92,018 easy_install.exe
2017/03/05  15:30            91,990 pip.exe
2017/03/05  15:30            91,990 pip2.7.exe
2017/03/05  15:30            91,990 pip2.exe
2017/03/05  15:30            27,136 python.exe
2017/03/05  15:30            27,648 pythonw.exe
2017/03/05  15:30            91,997 wheel.exe

使用easy_install acicobra-1.3_2h-py2.7.egg命令进行安装  使用easy_install  acimodel-1.3_2h-py2.7.egg安装另外一个包

D:\python\aci\Scripts>easy_install acicobra-1.3_2h-py2.7.egg
Processing acicobra-1.3_2h-py2.7.egg
creating d:\python\aci\lib\site-packages\acicobra-1.3_2h-py2.7.egg
Extracting acicobra-1.3_2h-py2.7.egg to d:\python\aci\lib\site-packages
Adding acicobra 1.3-2h to easy-install.pth file
Installed d:\python\aci\lib\site-packages\acicobra-1.3_2h-py2.7.egg
Processing dependencies for acicobra===1.3-2h
Searching for requests
Reading https://pypi.python.org/simple/requests/
Best match: requests 2.13.0
Downloading https://pypi.python.org/packages/16/09/37b69de7c924d318e51ece1c4ceb6
79bf93be9d05973bb30c35babd596e2/requests-2.13.0.tar.gz#md5=921ec6b48f2ddafc8bb61
60957baf444
Processing requests-2.13.0.tar.gz
Writing c:\users\hs\appdata\local\temp\easy_install-si1rs1\requests-2.13.0\setup
.cfg
Running requests-2.13.0\setup.py -q bdist_egg --dist-dir c:\users\hs\appdata\loc
al\temp\easy_install-si1rs1\requests-2.13.0\egg-dist-tmp-ue8g6c
warning: no files found matching 'test_requests.py'
warning: no files found matching 'requirements.txt'
creating d:\python\aci\lib\site-packages\requests-2.13.0-py2.7.egg
Extracting requests-2.13.0-py2.7.egg to d:\python\aci\lib\site-packages
Adding requests 2.13.0 to easy-install.pth file
Installed d:\python\aci\lib\site-packages\requests-2.13.0-py2.7.egg
Finished processing dependencies for acicobra===1.3-2h

通过pip freeze和pip show acimodel 查看是否安装成功

D:\python\aci\Scripts>pip freeze
acicobra===1.3-2h
acimodel===1.3-2h
requests==2.13.0
wheel==0.24.0
D:\python\aci\Scripts>pip show acimodel
Metadata-Version: 1.1
Name: acimodel
Version: 1.3-2h
Summary: The Management Information Tree
Home-page: UNKNOWN
Author: Cisco Systems
Author-email: mtimm@cisco.com
License: Cisco Systems Inc. (Copyright 2014)
Location: d:\python\aci\lib\site-packages\acimodel-1.3_2h-py2.7.egg
Requires: acicobra

最后在pycharm里面查看

aci-python.png

发表评论

电子邮件地址不会被公开。 必填项已用*标注