Install Gramex

There are 4 ways of installing or upgrading the Gramex Community Edition.

  1. Conda (RECOMMENDED). Best for beginners and Python developers
  2. Docker. Best to try out new versions, or to deploy apps
  3. Pip. Best for people contributing to Gramex
  4. Offline. Best for machines without an Internet connection

Conda install

Install Anaconda3-2020.02. (Gramex does not yet work with Python 3.8. So avoid later versions). Here are downloads for:

To install gramex, type this in your Anaconda Prompt / shell:

conda create -y --name gramex python=3.7            # Create a new environment
conda activate gramex                               # Activate it
conda install -y -c conda-forge -c gramener gramex  # Install Gramex

Run gramex --help to verify that Gramex is installed.

Upgrade Gramex via conda

To upgrade Gramex, run:

conda update gramex

Docker install

Install Docker first.

Once Docker is running, to run gramex, type this in your Command Prompt / Terminal / shell:

docker pull gramener/gramex
docker run -it --name gramex -p 9988:9988 gramener/gramex /bin/bash

Inside the container, run gramex --help to verify that Gramex is installed.

Upgrade Gramex via docker

To upgrade Gramex, run:

docker pull gramener/gramex

Pip install

Install Anaconda3-2020.02. (Gramex does not yet work with Python 3.8. So avoid later versions). Here are downloads for:

Then install node.js 10 or later

Now run the following commands on the terminal

pip install gramex      # Install latest version of Gramex
npm install -g yarn     # Required for UI components and built-in apps
gramex setup --all      # Set up UI components and built-in apps

Run gramex --help to verify that Gramex is installed.

You can also install specific versions or tags of Gramex:

# Install a specific version of Gramex
pip install --verbose gramex==1.47.0

# Install a specific branch or tag from the Gramex source code
pip install --verbose https://github.com/gramener/gramex/archive/dev.zip
pip install --verbose https://github.com/gramener/gramex/archive/v1.47.0.zip

If you’re developing on Gramex, clone it and install a local version:

git clone https://github.com/gramener/gramex.git
pip install --verbose -e gramex

Upgrade Gramex via pip

To upgrade Gramex, run:

pip install --upgrade gramex
gramex setup --all

Troubleshooting

If Gramex does not install:

If Gramex does not run:

Offline install

Install Gramex using conda on a system with an Internet connection and the same platform (Windows/Linux) as the target system. Then run these commands (for Linux):

# Install Miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p gramex-offline
gramex-offline/bin/conda init bash

# Now RESTART the shell to activate Conda.

# Then install Gramex
conda create -y --name gramex python=3.7            # Create a new environment
conda activate gramex                               # Activate it
conda install -y -c conda-forge -c gramener gramex  # Install Gramex

Then copy the gramex-offline folder into the target system (which need not have an Internet connection). Also copy your app. Then run gramex-offline/bin/gramex from your app folder.

Offline Docker Install

Install Docker on a system with an Internet connection. Then run these commands.

# Replace "app" anywhere in this script with any app name of your choice.
docker pull gramener/gramex
docker run -it --name app gramener/gramex /bin/bash

  # Inside the container, copy your app and make any changes required.
  # For example, this clones the Gramex Guide into /app
  git clone https://github.com/gramener/gramex-guide/ /app
  exit

# Save the container as a new image
docker commit app gramener/app
docker save gramener/app > app.tar

Then:

  1. Install Docker on the target machine.
  2. Copy app.tar to the target machine. Zip and split it if required.

On the target machine, run:

docker load < app.tar
docker run -it --name app -p 9988:9988 -w /app gramener/app gramex

Install Gramex Enterprise

Gramex Enterprise is offered under a commercial license and provides enterprise security features.

To install it, install Gramex first.

Then run:

pip install gramexenterprise    # Install Gramex Enterprise
gramex license accept           # Accept the Gramex license

Upgrade Gramex Enterprise

To upgrade Gramex Enterprise, run:

pip install --upgrade gramexenterprise

VSCode Extension

Install Gramex Snippets extension for VSCode IDE for Gramex related code snippets. Visit VSCode Extension page for more details.