[LINUX] I installed Swift tools to use ObjectStorage @ Bluemix (Python / pip, etc.)

Last time, I just tried it with GUI for the time being, so it's a continuation. http://qiita.com/azzeten/items/fca985f9847600a0b2e9

I tried to prepare on the OS side according to the Bluemix manual. https://console.ng.bluemix.net/docs/services/ObjectStorage/index.html#using-swift-cli

It seems that you need to install the Swift tool (swiftclient) and use pip for it ... However, the story starts on the premise that this manual and pip are installed, and since pip is not included in my environment in the first place, I will start from there ... Well, I stumbled on various things, so I will write it down.

Install the packages required to install pip

Package installation

$ sudo yum install gcc make fuse fuse-devel curl-devel libxml2-devel openssl-devel git

Loading fuse

$ sudo modprobe fuse

Since python itself was included, I didn't install it in particular ... Confirmed for the time being.

$ sudo which python
/bin/python

Install pip

Get the file at the specified URL with curl and process it with python. It was a little strange, so I will post the log. It says failed, but especially. .. It was okay (because the following worked properly).

$ sudo curl -kL https://bootstrap.pypa.io/get-pip.py | python

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1487k  100 1487k    0     0  4553k      0 --:--:-- --:--:-- --:--:-- 4561k
Collecting pip
/tmp/tmp45LTIF/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
/tmp/tmp45LTIF/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 733kB/s
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 7.9MB/s
Installing collected packages: pip, wheel
Successfully installed pip-8.1.1 wheel-0.29.0
/tmp/tmp45LTIF/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

Install Swift Client

Finally, install swiftclient!

$ sudo pip install python-swiftclient
$ sudo pip install python-keystoneclient

So, I thought it was okay ♪, but when I actually tried to use object storage later, it didn't work. Not only the Bluemix manual, but also the link posted there, I finally solved it. http://docs.openstack.org/user-guide/common/cli_install_openstack_command_line_clients.html#install-the-prerequisite-software

It seems that you also need to install python-devel. Kya. .. By the way, I was angry with such an error.

    checking for netlink support...yes.
    will use netlink to read routing table
    building 'netifaces' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DNETIFACES_VERSION=0.10.4 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_LINUX_IRDA_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_LINUX_DN_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_DN=1 -DHAVE_SOCKADDR_IRDA=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/usr/include/python2.7 -c netifaces.c -o build/temp.linux-x86_64-2.7/netifaces.o
    netifaces.c:1:20:Fatal error: Python.h:There is no such file or directory
     #include <Python.h>
                        ^
Compiling has stopped.
    error: command 'gcc' failed with exit status 1

I did a lot of research ... So I'll solve it below.

#python-install devel
$ sudo yum install python-devel

#Revenge!
$ sudo pip install python-keystoneclient

That's all!

Next time, I will write from the point of looking at the Object Storage file from Linux.

Recommended Posts

I installed Swift tools to use ObjectStorage @ Bluemix (Python / pip, etc.)
I installed Python 3.5.1 to study machine learning
I want to use jar from python
Install python on xserver to use pip
I want to use MATLAB feval with python
I want to use Temporary Directory with Python2
I want to use ceres solver from python
I tried to graph the packages installed in Python
I wanted to use the Python library from MATLAB
I tried to summarize how to use pandas in python
I want to use the R dataset in python
[Python] I want to use the -h option with argparse
[Python] I installed the game from pip and played it
I didn't know how to use the [python] for statement
I want to know the features of Python and pip
python3: How to use bottle (2)
[Python] How to use list 1
How to use Python argparse
Python: How to use pydub
[Python] How to use checkio
[Python] How to use input ()
How to use Python lambda
[Python] How to use virtualenv
python3: How to use bottle (3)
python3: How to use bottle
How to use Python bytes
When I tried to use pip with python, I was told that XML_SetHashSalt could not be found.
I couldn't use tkinter with python installed by pyenv of anyenv
I want to use a wildcard that I want to shell with Python remove
How to use Python Kivy (reference) -I translated Kivy Language of API reference-
I want to use both key and value of Python iterator
When I try to use pip, SSL module is not available.
Python> Comprehension> cells> I was taught how to use double comprehension / itertools
Python: How to use async with
I tried to touch Python (installation)
[Python] How to use Pandas Series
How to use Requests (Python Library)
How to use SQLite in Python
[Introduction to Python] Let's use pandas
[Python] How to use list 3 Added
How to use Mysql in python
How to use OpenPose's Python API
How to use ChemSpider in Python
How to use FTP with Python
Python: How to use pydub (playback)
How to use PubChem in Python
Easy to use Jupyter notebook (Python3.5)
[Introduction to Python] Let's use pandas
How to use python zip function
I want to debug with Python
[Introduction to Python] Let's use pandas
[Python] How to use Typetalk API
I made a Docker container to use JUMAN ++, KNP, python (for pyKNP).
[Python] I made a decorator that doesn't seem to have any use.
I wanted to use jupyter notebook with docker in pip environment (opticspy)
[AWS] [GCP] I tried to make cloud services easy to use with Python
Use Python from Java with Jython. I was also addicted to it.
I tried with the top 100 PyPI packages> I tried to graph the packages installed on Python
[Python] I was hooked for an hour trying to use list comprehensions
A memorandum because I stumbled on trying to use MeCab in Python
After all, what should I use to do type comparisons in Python?