- Linux, MacOS, or Windows
- Docker, Docker Compose, allowing non-root users
- Python 3.8.5 - Python 3.10.4, Python 3.11 with some manual alterations
(If you have issues, see "Potential issues & workarounds" section below.)
In a new console:
# Create your working directory
mkdir my_project
cd my_project
# Initialize virtual environment and activate it. Install artifacts.
# Make sure your Python version inside the venv is >=3.8.
# Anaconda is not fully supported for now, please use venv
python3 -m venv venv
source venv/bin/activate
# Avoid errors for the step that follows
pip install wheel
# Install Ocean library.
pip install ocean-libIssue: M1 * coincurve or cryptography
- If you have an Apple M1 processor,
coincurveandcryptographyinstallation may fail due missing packages, which come pre-packaged in other operating systems. - Workaround: ensure you have
autoconf,automake,libtoolandpkg-configinstalled, e.g. using Homebrew or MacPorts.
Issue: Could not build wheels for coincurve
- Reasons for this happening are usually missing dependencies.
- Workaround:
- make sure you have the OS-level development libraries for building Python packages:
python3-devandbuild-essential(install e.g. using apt-get) - install the OS-level
libsecp256k1-devlibrary (e.g. using apt-get) - install pyproject.toml separately, e.g.
pip install pyproject-toml - if ocean-lib installation still fails, install coincurve separately e.g.
pip install coincurve, then retry
- make sure you have the OS-level development libraries for building Python packages:
Issue: MacOS "Unsupported Architecture"
- If you run MacOS, you may encounter an "Unsupported Architecture" issue.
- Workaround: install including ARCHFLAGS:
ARCHFLAGS="-arch x86_64" pip install ocean-lib. Details.
Issue: Dependencies and Python 3.11
- ocean.py depends on the
parsimoniouspackage. In turn,parsimoniousdepends ongetargsspec, which doesn't support Python 3.11. The workaround: open the package's expressions.py file (e.g. in ./venv/lib/python3.11/site-packages/parsimonious/expressions.py), and change the lineimport getfullargspec as getargsspecinstead of the regular import.
You've now installed Ocean, great!
Next step is setup: