Installation: Python Clients
This page covers the installation of the Python clients. Please visit this page for instructions on installing the Inference Server and Training Module.
The Python clients allow you to interact with the NuPIC Inference Server and Training Module. By leveraging these clients, you can efficiently manage dependencies, fine-tune your model with optimized computational resources and deploy models for inference with minimal overhead.
Installation Options
The clients can be installed on the same machine as the Inference Server and Training Module. This is suitable for evaluation purposes. In a production scenario, the clients will most likely be installed on end-user machines, and will facilitate communication with the Inference Server and Training Modules running on remote infrastructure. See this page for details on installation options.
Directory Structure
From the nupic/
directory, navigate to the nupic.examples/
folder:
cd nupic.examples
The folder should look like this:
nupic.examples/
├── create_examples_venv.sh ---------> Defines virtual environment
├── environment.yml -----------------> Defines conda environment
├── examples/ -----------------------> Example code for specific use-cases
├── inference_server_versions
├── LICENSE
├── licenses/
├── MANIFEST.in
├── pyproject.toml
├── README.md
├── scripts/
├── setup.cfg
├── setup.py
├── src/nupic/client
│ └──
│ ├── inference_client.py ---------> Interacts with Inference Server
│ ├── __init__.py
│ ├── langchain
│ ├── nupic_train.py
│ ├── README.md
│ ├── requirements.txt
│ └── training_client.py ----------> Interacts with Training Module
├── tests/
└── training_module_versions
Installing Dependencies
There are two main ways to install Python libraries needed for NuPIC clients: venv or conda. Both can installed by navigating to the nupic/
directory and running the installation menu using source install.sh
.
For MacOS, please do so within a bash terminal instead of the default zsh by first running /bin/bash
. The installed dependencies will be subsequently available in zsh as well.
=======================================================
== NuPIC: Numenta Platform for Intelligent Computing ==
=======================================================
What would you like to install?
1. Inference Server
2. Training Module
3. Python client using venv
4. Python client using conda
5. (Advanced) Python client using venv, without examples
6. (Advanced) Python client using conda, without examples
Please respond with comma-separated values without spaces (e.g., 1,2),
or press Enter to install defaults (1–3):
Venv
You can select 3
to install Python dependencies using venv. This is included in a default installation from the menu. When successful, you should see the newly created virtual environment prepended to your shell prompt:
(nupic_examples_env) ubuntu@ip-10-0-5-96:~/nupic/nupic.examples$
If not, run the command source nupic_examples_env/bin/activate
.
Conda
Alternatively, if you chose to use conda (by selecting 4
in the installation menu), you should see the newly activated conda environment prepended to your shell prompt:
(nupic.examples) ubuntu@ip-10-0-5-96:~/nupic/nupic.examples$
If not, run the command conda activate nupic.examples
.
Just the Clients
A more lightweight alternative is to only install the dependencies that are strictly required for the Python clients. This approach does not install the dependencies needed for some of the examples in nupic.examples/examples
.
This method is recommended only for advanced users who do not require our worked examples for reference. You can do so by selecting 5
or 6
in the installation menu.
Updated 3 months ago