473,372 Members | 836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

A question about Alibaba Cloud OSS python SDK

22
I have a question about OSS python SDK. Does a directory exists, and if so, how can I represent the directory?
path_exist = bucket.object_exists('release/plugins/')
I wrote the code above, but the returned result states that it does not exist.
Mar 27 '18 #1
2 1783
Alibaba Cloud Object Storage Python SDK 2.x. This version is not compatible with the previous version (Version 0.x). The package name is oss2 to avoid conflict with previous versions. The SDK of this version is dependent on the third-party HTTP library requests and crcmod. Install the SDK following the methods below
Mar 27 '18 #2
IvanH
51
This service is introduced only on Alibaba Cloud Object Storage Service (OSS) V2.0. In V1.0, image resources are mainly stored in the specific directories of Alibaba Cloud ECS hosts.
During each system upgrade, data backup is required. A large part of the backup data is image resource files. Starting from the v2.0, Alibaba Cloud stores the image resources and web resources and other data used in applications on the OSS. Therefore, when data backup is required during each system upgrade, it is not necessary to backup image resource files, thus reducing the size of backup files and the backup time.
After OSS is used, image resource files generated by v1.0 need to be completely migrated to OSS. OSS provides SDKs for Python for operating OSS. Therefore, python is used as the development tool to migrate image resource files.
The development environment is CentOS 6.4.
1. Check python development environment
Run the command on the console: python
If the output content is: command not found, it indicates that python is not installed. Install python with the command: yum install python. After the command is executed, the installation starts.
2. Check whether pip and setuptools exist
pip and setuptools are python package management tool. Run pip. If the command does not exist, you must install it. In centos, currently the two tools cannot be directly installed with yum. You can download get-pip.py script in the following link:https://pip.pypa.io/en/stable/installing/. Use the command: python get-pip.py to complete the installation of pip and setuptools.
3. Install oss2
The latest oss sdk is oss2 which is incompatible with previous versions. Run the command: pip install oss2 to complete the installation of oss2.
4. Check whether the oss2 environment is configured
Enter the command: python
Enter the following command: import oss2 and press Enter.
The preceding output content indicates that oss2 development environment is successfully created.
Mar 28 '18 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dan1701 | last post by:
Is building a Hadoop cluster on Alibaba Cloud with CM + CDH supported?
0
by: IvanH | last post by:
Does Alibaba Cloud ECS Automatic Backup Occupy Server Space?*
0
by: IvanH | last post by:
Can Alibaba Cloud ECS defend against attacks?*
0
by: IvanH | last post by:
What lines are used by Alibaba Cloud ECS?*
0
by: IvanH | last post by:
Does Alibaba Cloud have CDN service?
0
by: IvanH | last post by:
Can OS be Switched or Automatically Added/Upgraded on Alibaba Cloud?
0
by: IvanH | last post by:
https://www.decent.vip My website uses Alibaba Cloud OSS and Alibaba Cloud CDN for Wordpress.It said I can visit this page but it returns a 403 error. And the icon is not there. What can I do?
0
by: IvanH | last post by:
How Can I Migrate from F(x) Data Cloud to Alibaba Cloud when I do web hosting?
1
by: Andrea1701 | last post by:
About secondary partitioning on Alibaba Cloud ECS system disks and data disks. How many partitions are there after I perform secondary partitioning on a data disk and perform snapshot rollback?
1
by: Andrea1701 | last post by:
In the Alibaba Cloud Docker Machine ECS driver document, only the installation method for Mac is provided. But I downloaded the ECS Driver for Windows since my computer's operating system is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.