You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can install the Python SDK from GitHub or through the Python Package Index (PyPI).
33
+
You can install the Python SDK through the Python Package Index (PyPI), or alternatively through GitHub.
34
+
35
+
**PyPi**
36
+
37
+
To install from `PyPI <https://pypi.python.org/pypi/oraclebmc>`_:
38
+
39
+
Use the following command::
40
+
41
+
pip install oraclebmc
42
+
43
+
**GitHub**
44
44
45
45
To install from GitHub:
46
46
@@ -56,15 +56,10 @@ To install from GitHub:
56
56
If you're unable to install the whl file, make sure pip is up to date.
57
57
Use ``pip install -U pip`` and then try to install the whl file again.
58
58
59
-
To install from `PyPI <https://pypi.python.org/pypi/oraclebmc>`_:
60
-
61
-
Use the following command::
62
59
63
-
pip install oraclebmc
60
+
**Virtual environment (Optional)**
64
61
65
-
66
-
(Optional)
67
-
Oracle recommends that you run the SDK in a virtual environment with virtualenv.
62
+
Although optional, Oracle recommends that you run the SDK in a virtual environment with virtualenv.
68
63
69
64
With Linux, it's usually in a separate package from the main Python package.
70
65
If you need to install virtualenv, use pip install virtualenv.
@@ -89,104 +84,55 @@ For instructions, see `SDK and Tool Configuration`_ in the User Guide.
89
84
90
85
.. _SDK and Tool Configuration: https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm
91
86
92
-
====================
93
-
Note for OSX Users
94
-
====================
87
+
Verify OpenSSL Version
88
+
----------------------
95
89
96
-
OS X already has Python and OpenSSL preinstalled. However, the preinstalled OpenSSL is probably not version 1.0.x or
97
-
newer, which is what you need. To check whether you have a supported OpenSSL version, run this command::
90
+
The supported version of OpenSSL for the Python SDK is version 1.0.1 or newer. Run the following command to find out the version of OpenSSL that you have::
If the version is ``0.9.x``, you need to reinstall Python and OpenSSL using Homebrew
102
-
(a package manager for the OS X platform).
103
-
104
-
If you've never used Homebrew to install Python on the system, follow these instructions:
105
-
106
-
1. Download and install `Homebrew`_.
107
-
2. Use these commands to update Homebrew and then install OpenSSL and Python:
108
-
::
94
+
If the version is lower than ``1.0.1``, run the following command to bypass the version issue::
109
95
110
-
brew update
111
-
brew install openssl
112
-
brew install python
113
-
114
-
.. note::
96
+
pip install requests[security]
115
97
116
-
If you get a "Permission denied" message when running any brew command, it's probably because
117
-
the OS X permissions model conflicts with Homebrew's default installation location of ``/usr/local``.
118
-
You can usually fix this by taking back control of the folder with ``sudo chown -R $(whoami) /usr/local``.
98
+
This command instructs the `requests <https://pypi.python.org/pypi/requests>`_
99
+
library used by the Python SDK to use the version of OpenSSL that is bundled with the `cryptography <https://pypi.python.org/pypi/cryptography>`_
100
+
library used by the SDK.
119
101
120
-
Check the OpenSSL version again. If it's still 0.9, see `Troubleshooting Mac Issues`_.
102
+
**Note:**
103
+
If you don't want to use ``requests[security]`` you can update OpenSSL as you normally would. For example, on OS X, use Homebrew to update OpenSSL using the following commands::
121
104
122
-
.. _Homebrew: http://brew.sh/
105
+
brew update
106
+
brew install openssl
107
+
brew install python
123
108
124
109
=================
125
110
Troubleshooting
126
111
=================
127
112
128
113
You might encounter issues when installing Python or the SDK, or using the SDK itself.
129
114
130
-
----------------------------
131
-
Troubleshooting OEL Issues
132
-
----------------------------
133
-
On OEL 7.3, if you encounter permission issues when running pip install, you might need to use ``sudo``.
115
+
Service Errors
116
+
--------------
117
+
Any operation resulting in a service error will cause an exception of type oraclebmc.exceptions.ServiceError to be thrown by the SDK. For information about common service errors returned by BMCS, see `API Errors <https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm>`_
118
+
.
134
119
135
-
----------------------------
136
-
Troubleshooting Mac Issues
137
-
----------------------------
120
+
Oracle Linux Permission Issues
121
+
------------------------------
122
+
On Oracle Linux 7.3, if you encounter permission issues when running pip install, you might need to use ``sudo``.
138
123
139
-
There are several general types of issues you might encounter.
140
-
141
-
OpenSSL Version Still 0.9.x
142
-
===========================
143
-
144
-
If the Python installation instructions listed in Mac above still result in OpenSSL version 0.9.x,
145
-
it might be one of these reasons:
146
-
147
-
* Your python command is pointing to the wrong Python installation. To check, use the which python command.
148
-
The default system Python is at ``/usr/bin/python``, whereas the Homebrew-installed version that you want
149
-
is typically at ``usr/local/bin``. Edit the ``etc/paths`` file to move the ``usr/local/bin`` line to the
150
-
top of the list. Don't remove the system Python line.
151
-
152
-
* Your virtualenv is pointing to the wrong Python installation. By default, virtualenv uses ``/usr/bin/python``,
153
-
whereas the Homebrew-installed Python is typically at ``usr/local/bin``. To fix this, use this command::
154
-
155
-
virtualenv -p <path to Homebrew Python> <directory for the virtualenv>
156
-
157
-
For example, if your installation is at /usr/local/bin/python::
158
-
159
-
virtualenv -p /usr/local/bin/python bmcs_sdk_env
160
-
161
-
To determine the location of your Homebrew-installed Python, try one of these commands::
162
-
163
-
brew info python
164
-
which -a python # (the -a option lists all the Python installations)
165
-
brew doctor
166
-
167
-
If the above items don't fix the problem, the best strategy is to uninstall and reinstall Python with the following
168
-
commands. Note that you will need to reinstall any packages you previously installed into Homebrew's Python via pip.
169
-
::
170
-
171
-
brew uninstall openssl
172
-
brew uninstall python
173
-
brew update
174
-
brew install python
175
-
176
-
If you're still having problems, you may need slightly different commands depending on the version of Homebrew
177
-
that was used to install your Python or OpenSSL libraries. Here's a recent post that may be helpful:
When trying to use the SDK, if you get an exception related to SSL/TLS or certificates/certificate validation,
186
-
the underlying issue is that OpenSSL is the wrong version (0.9.x). See the solution for uninstalling and
187
-
reinstalling Python above. Make sure to also reinstall the wheel with this command::
188
-
189
-
pip install oraclebmc-*-py2.py3-none-any.whl
124
+
SSL/TLS or Certificate Issues
125
+
-----------------------------
190
126
127
+
When trying to use the SDK, if you get an exception related to SSL/TLS or certificates/certificate validation, see the command for installing requests[security] in `Verify OpenSSL Version`_.
0 commit comments