473,388 Members | 1,426 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,388 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 1786
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...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.