python3.3.5x64+win2003x64+aliyun oss sdk安装步骤

参考文章:https://help.aliyun.com/document_detail/32026.html?spm=5176.doc31890.6.690.S6ZrRn

1、安装python3.3.5x64

2、pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 binaries downloaded from python.org, but you'll need to upgrade pip.

因为我们是python3.3.5版本,所以需要安装pip

https://pip.pypa.io/en/stable/installing/?spm=5176.doc32026.2.9.raeYMb

在页面下载

https://bootstrap.pypa.io/get-pip.py

安装pip

python get-pip.py

3、安装阿里云oss sdk

pip install oss2

如果操作系统不识别pip命令,那么pip在c:python3.3script里可以找到

c:python3.3scriptpip install oss2

4、验证

5、这里碰到一个问题,阿里云说oss的sdk默认使用crcmod的C扩展模式,但是我反复安装,只有在python2.7下成功安装,原因不详。。。。所以这里我就放弃了crc校验。

6、关于放弃CRC校验

上传、下载文件默认开启CRC数据校验,确保上传、下载过程的数据完整性。CRC数据校验使用 crcmod 模块计算传输数据的CRC64,如果 crcmod 的C扩展模块没有安装成功,计算CRC64的效率较差。判断C扩展模块是否安装的方法,请参看 安装SDK。如果 crcmod 的C扩展模块没有安装成功,请配置编译环境重新安装 或 关闭CRC数据校验功能。关闭CRC数据校验功能的方法如下:

# -*- coding: utf-8 -*-
import oss2
auth = oss2.Auth('您的AccessKeyId', '您的AccessKeySecret')
endpoint = 'http://oss-cn-hangzhou.aliyuncs.com' # 假设Bucket处于杭州区域
bucket = oss2.Bucket(auth, endpoint, '您的Bucket名', enable_crc=False)
原文地址:https://www.cnblogs.com/itfat/p/8330121.html