Creating a Python virtual environment resource
After you have created the requirements.txt file,
you can create the Python virtual environment resource.
Before you begin
- You must create a requirements.txt file specifying the Python package and version dependencies required by your Cloudera Data Engineering job.
- The following hostnames must be reachable from within the cluster, to install the
Python package successfully if no PyPi mirror is configured:
- pypi.python.org
- pypi.org
- pythonhosted.org
- files.pythonhosted.org
Steps
- In the Cloudera Data Engineering UI, click Resources in the left navigation menu and then click Create Resource.
- Specify a resource name, and then select Python Environment from the Type drop-down menu.
- Choose the Python version for the environment and optionally specify the PyPi Mirror URL. The PyPi mirror must be accessible from the Cloudera environment.
- Click Create.
- Go to the python environment resource, click Upload and select
the
requirements.txtfile from your local machine. You can also drag-and-drop the file to the outlined area on the page.
Result
The UI displays Building the resource... while the Python virtual environment is building. After the environment is built, the page displays the Python packages and versions included in the environment.
Click the Logs tab to see the logs of the python environment build.
