Setting up your pycharm development environment


It is advisable to set up a separate python virtual environment for each xpresso.ai solution you’re working on. Here’s how to do this (follow these steps only after you have created an xpresso.ai solution):

  1. Make sure you have created a solution using the xpresso.ai Controller

  2. Clone the solution code onto your machine by using git clone

  3. Create a new project using this code inside your IDE (e.g., PyCharm)

  4. Create a virtual environment for the new project inside your IDE (e.g., in PyCharm, click “File–>Settings–>Project Interpreter”, and add a new virtual environment using the “Add..” item from the settings drop-down list at the top right-hand corner. Xpresso supports python version 3.7.4+. Make sure your local environment is setup accordingly.

image1

5. Set up all pre-requisities required by xpresso.ai by running pip3 install -r <project>/xpresso_ai/requirements.txt from inside the virtual environment

6. Alluxio is a required set of libraries required by xpresso.ai data connectors to access data from different file systems. This must be installed on client systems. Since there’s an issue with installation using pip, this has to be installed from source code. For this,

Specify Environment Variables

  • The environment variable XPRESSO_PACKAGE_PATH is set to “xpresso_ai - this enables the Python Interpreter to find the xpresso.ai libraries referenced in your code

  • The environment variable PYTHONPATH should be set to “xpresso_ai”

  • The environment variable XPRESSO_CONFIG_PATH should be set to “config/common.json” - this enables xpresso.ai to be configured properly

  • The environment variable enable_local_execution is set to True - this shuts off some functionality (e.g., reporting status, etc.) which require a connection to the xpresso.ai Controller, to enable completely local testing.

(It may be useful to create a shell script / batch file to set the above variables, for convenience, or to set them within your IDE - see below for PyCharm)

image2