- Oracle В® Linux 8
- Installing and Managing Python
- Oracle Legal Notices
- Oracle Documentation License
- ChapterВ 2В Installing Python
- 2.1В Installing Python 2
- 2.2В Installing Python 3
- 2.3В Installing Additional Python Libraries
- Installing python on oracle linux
- Install Python and Additional Libraries
- Upload the API and the Machine Learning Model
- Install and Configure Gunicorn on Oracle Linux
- Install and Configure Nginx on Oracle Linux
Oracle В® Linux 8
Installing and Managing Python
Oracle Legal Notices
Copyright В© 2020, 2021, Oracle and/or its affiliates.
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are «commercial computer software» or «commercial computer software documentation» pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms governing the U.S. Government’s use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.
Oracle Documentation License
This document uses the Web-based Help format from DocBook XML. The following license information applies to this format.
Copyright В© 1999-2007 Norman Walsh
Copyright В© 2003 Jiri Kosek
Copyright В© 2004-2007 Steve Ball
Copyright В© 2005-2008 The DocBook Project
Copyright В© 2011-2012 O’Reilly Media
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the «Software»), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Except as contained in this notice, the names of individuals credited with contribution to this software shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the individuals in question.
Any stylesheet derived from this Software that is publicly distributed will be identified with a different name and the version strings in any derived Software will be changed so that no possibility of confusion between the derived package and this Software will exist.
THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Web-based Help from DocBook XML
Copyright В© 2008-2012 Kasun Gajasinghe, David Cramer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Except as contained in this notice, the names of individuals credited with contribution to this software shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the individuals in question.
Any stylesheet derived from this Software that is publicly distributed will be identified with a different name and the version strings in any derived Software will be changed so that no possibility of confusion between the derived package and this Software will exist.
Warranty: THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DAVID CRAMER, KASUN GAJASINGHE, OR ANY OTHER CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Certain search characteristics associated with the DocBook XSL webhelp stylesheets are provided as javascript files generated using Apache Lucene and other fourth party technologies, which are licensed under the Apache License reproduced below.
Источник
ChapterВ 2В Installing Python
This chapter describes how to install multiple versions of Python and switch between them on the same Oracle Linux 8 system.
To install Python and prerequisites, use the dnf module install command. Multiple versions of Python can be installed and used simultaneously on the same machine, such as Python 2.7 and Python 3.6. You can specify which version you intend to use as follows:
The python command is not aliased by default in Oracle Linux 8. Specify the Python interpreter version with the python2 and python3 commands when you launch Python scripts.
If you need to alias the python command to fix compatibility problems with existing scripts and applications, you can set it manually. For example, to set Python 2 as the default interpreter version:
For more information about using the python command, see the python(1) manual page.
2.1В Installing Python 2
Python 2 is no longer maintained by the Python community. Oracle strongly recommends that you migrate your existing Python 2 scripts and applications to Python 3.
To learn about about the 2to3 automated migration tool visit https://docs.python.org/3/library/2to3.html. See also the porting guide at https://portingguide.readthedocs.io/en/latest/ for more in-depth information.
To install Python 2.7 on your Oracle Linux 8 system:
2.2В Installing Python 3
To install Python 3.6 on your Oracle Linux 8 system:
If you are running Oracle Linux 8.2 or later, you can optionally also install Python 3.8:
Both Python 3 modules can be installed and used simultaneously on the same machine, and you can specify which installation you intend to use as follows:
By default, the python3 command is always aliased to Python 3.6 if it is installed on the system, but you can change it manually. For example, to set Python 3.8 as the default interpreter for the python3 command:
2.3В Installing Additional Python Libraries
You can also install additional dependencies from the Oracle Linux yum server. For example, to install the requests library for Python 2, you would install the python2-requests package:
Dependencies that are installed in this way are available for any compatible Python installations on the same system. In addition, any matching packages can also be safely removed without also removing existing Python installations.
Copyright В© 2020, 2021, Oracle and/or its affiliates. Legal Notices
Источник
Installing python on oracle linux
To set up an Oracle Linux instance on Oracle Cloud Infrastructure, install Python 3.6, Nginx for use as a proxy, and Gunicorn as the web server gateway interface (WSGI) server. Also upload the machine learning model that the API uses.
Other proxies and WSGI servers are available, but both Gunicorn and Nginx provide the performance that’s needed without being over-complicated or resource-heavy.
Install Python and Additional Libraries
The default Python on Oracle Linux 7.6 and 7.7 is 2.7, but you need Python 3. Also install the Flask framework and the dependencies for the machine learning model.
- Log into your Oracle Linux compute instance.
- Install Python 3.6.
If your model relies on other libraries such as tensorflow or pandas, install those too.
Upload the API and the Machine Learning Model
Upload the two API files and the machine learning model to your Oracle Linux instance on Oracle Cloud Infrastructure Compute .
After uploading, run a couple of tests to make sure everything is working.
To upload and test your files:
- Run the following commands in a Bash terminal on your local development system.
Use the private key that corresponds to the public key that you used when provisioning the instance.
The response should be similar to «54%» and may differ depending on how you built your model. Also, the response is displayed before the Bash prompt, as shown in the following snippet:
The response should be similar to «0.54» and may differ depending on how you built your model.
Install and Configure Gunicorn on Oracle Linux
Install and configure the Gunicorn WSGI server to start on system boot. Also configure Gunicorn to communicate with the Nginx proxy via a UNIX socket which is more efficient and secure than using a TCP/IP socket (ie, http://127.0.0.1).
To install and configure Gunicorn:
- Log into your compute instance and activate the apienv environment.
The mlapi.sock file that’s specified in the ExecStart line is created in the WorkingDirectory by Gunicorn when it starts up the first time. This is the file that Gunicorn and Nginx use to communicate with each other instead of through a TCP socket.
Install and Configure Nginx on Oracle Linux
The built-in server that Flask provides is not suited for production use. To safely expose your API to the network, you should use a Python WSGI server such as Gunicorn behind a proxy such as Nginx.
- Log into your compute instance.
- Install Nginx from the yum repository.
Connect your Skill Bot to a Machine Learning API
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are «commercial computer software» pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.
Источник