This how you can install ta-lib-0.6.3 on IDX Project

#NOTE: Create a Blank Workspace (only contain .idx)
1. Change the ‘dev.nix’ file and click ‘Rebuild Environment’ button

# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
  # Which nixpkgs channel to use.
  channel = "stable-24.05"; # or "unstable"
  # Use https://search.nixos.org/packages to find packages
  packages = [
    pkgs.gnumake
    pkgs.gcc

    # pkgs.go
    pkgs.python311
    pkgs.python311Packages.setuptools
    pkgs.python311Packages.wheel
    pkgs.python311Packages.pip
    # pkgs.nodejs_20
    # pkgs.nodePackages.nodemon

    pkgs.automake
    pkgs.autoconf
    pkgs.libtool
    pkgs.pkg-config  # Useful for library detection
  ];
  # Sets environment variables in the workspace
  env = {
    # Point to your local TA-Lib installation
    TA_LIBRARY_PATH = "/home/user/ta-lib-install/lib";
    TA_INCLUDE_PATH = "/home/user/ta-lib-install/include";
    LD_LIBRARY_PATH = "/home/user/ta-lib-install/lib:$LD_LIBRARY_PATH";
    PKG_CONFIG_PATH = "/home/user/ta-lib-install/lib/pkgconfig:$PKG_CONFIG_PATH";
  };
  idx = {
    # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
    extensions = [
      # "vscodevim.vim"
    ];
    # Enable previews
    previews = {
      enable = true;
      previews = {
        # web = {
        #   # Example: run "npm run dev" with PORT set to IDX's defined port for previews,
        #   # and show it in IDX's web preview panel
        #   command = ["npm" "run" "dev"];
        #   manager = "web";
        #   env = {
        #     # Environment variables to set for your server
        #     PORT = "$PORT";
        #   };
        # };
      };
    };
    # Workspace lifecycle hooks
    workspace = {
      # Runs when a workspace is first created
      onCreate = {
        # Example: install JS dependencies from NPM
        # npm-install = "npm install";
        # Open editors for the following files by default, if they exist:
        default.openFiles = [ ".idx/dev.nix" "README.md" ];
      };
      # Runs when the workspace is (re)started
      onStart = {
        # Example: start a background task to watch and re-build backend code
        # watch-backend = "npm run watch-backend";
      };
    };
  };
}

2. Install and Drag from your file exproler the ta-lib tar file (https://github.com/TA-Lib/ta-lib/releases/download/v0.6.4/ta-lib-0.6.4-src.tar.gz) to IDX Explorer
3. Create a local library, build the ta-lib and install it with pip

#NOTE: Run it one by one
#create local python environment
python -m venv .venv 

#Create a directory
mkdir /$HOME/ta-lib-install 

#Extract the tar file
tar -xzf ta-lib-0.6.4-src.tar.gz

#Access the extracted tar file folder
cd ta-lib-0.6.4

#Then run this
./configure --prefix=$HOME/ta-lib-install
#then 
make
#then 
make install

#Exit from tar file folder
cd ..

#Then use the .venv as your local environment
source .venv/bin/activate

#voila pip install your ta-lib
pip install ta-lib
1 Like

Really cool! Thanks for sharing :slight_smile:

@Buxy_S have you tried adding pkgs.ta-lib to dev.nix packages instead? I think that is all you have to do to be able to use it.

@Vova I don’t use pkgs.ta-lib, that’s already deprecated