#️⃣Source Code Installation

This tutorial describes the source code setup in Pycharm for Windows, Linux, and Mac.

Windows

  1. Installing Python Download and install any python >= 3.8 https://www.python.org/downloads/ make sure that path is added to environmental variables. [Python 3.12.0]

  2. Installing Pycharm Download and install Pycharm which supports VCS

  3. Installing Rust Many basic functions are implemented in Rust for fast execution. The Rust code is called from Python using Maturin. We will discuss about Maturin in the later section of this tutorial but first let's start downloading and installing Rust: https://www.rust-lang.org/tools/install Run the .exe and Choose the option (1) It will install Rust as well as Visual Studio C++ tools. After completing, run the command prompt and run this command to check if it is successfully installed [rustc 1.73.0]

rustc --version
  1. Installing StrawberryPerl The project uses the OpenSSL library and for that, Perl is needed. Don't worry you don't need to buy strawberries to install it just click the link https://strawberryperl.com. Download and install [Perl v5.38.0]

  2. Restart the computer Sometimes it is better to restart the computer so that installed compilers and tools are perfectly in sync with the operating system.

Generating Access Token from Github Generating a token is required when accessing any repository from Github Account β–Ά Setting β–Ά Developer Settings β–Ά Personal access token β–Ά

Open Project in Pycharm

select the Get from VCS

  1. Paste the URL then it will ask for an access token or an account link. Paste the access token that was generated in the previous step.

Creating a Python Virtual Environment

It is a standard practice to work on a virtual environment for each individual project so that dependencies don't conflict.

Open Terminal in Pycharm

check the python first by executing the command

python --version

creating a virtual environment

python -m venv env_aisdb_client 

activating the environment

.\env_aisdb_client\Scripts\activate

When you create a virtual environment, you will see a folder has been created in the project with name env_aisdb_client. It contains our python environment.

After activating the environment, a Python library needs to be installed

pip install maturin

Now, almost everything is done with the setup. We need to compile code to proceed and for that run this command

maturin develop --release --extras=test,docs

or

maturin develop 

make sure your current directory in the cmd should be the directory of the project

Tada! Everything is completed now.

If the develop is getting error about unavailability of unzip command then download [https://sourceforge.net/projects/gnuwin32/] unzip and set the bin path into environmental variables


Linux

# You first need to install the rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

rustc --version

# Create your VEnv
python -m venv AISdb
source ./AISdb/bin/activate

# You will require Maturin to build the package
pip install maturin
pip install patchelf

# Clone the source code and navigate to the package root
git clone https://github.com/AISViz/aisdb-client.git && cd aisdb-client

# Build and install AISdb to your VEnv
maturin develop --release --extras=test,docs

Mac

Last updated