The standard code-interpreter template starts from Python 3.12 and includes common data analysis, visualization, scraping, and ML packages.

Python Packages

numpy
pandas
matplotlib
seaborn
plotly
scipy
scikit-learn
pillow
requests
beautifulsoup4
nltk
opencv-python-headless
xgboost
Notebook/runtime packages include ipykernel, jupyter_client, and bash_kernel.

Install More Packages

machine.install_packages(["humanize==4.9.0"])
result = machine.run_code("""
import humanize
print(humanize.intword(1234567))
""")
print("".join(result.logs.stdout))
nullspace machine code install mch_123 humanize==4.9.0
nullspace machine code run mch_123 "import humanize
print(humanize.intword(1234567))"
# install_packages runs a pip command through the code interpreter
# returns a Server-Sent Events stream of JSON events
curl -N -X POST "${NULLSPACE_API_URL}/v1/machines/mch_123/code/execute" \
  -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"code": "!pip install humanize==4.9.0"}'
curl -N -X POST "${NULLSPACE_API_URL}/v1/machines/mch_123/code/execute" \
  -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"code": "import humanize\nprint(humanize.intword(1234567))"}'
Package installs affect the running machine. Build a custom template when a dependency should be preinstalled for many machines.