[Python] Installing ta-lib into specific directory in WSL (Windows Subsystem for Linux):

Discussão em 'Python' iniciado por Stack, Fevereiro 5, 2025.

  1. Stack

    Stack Membro Participativo

    I have a windows installation and plan to run GPU-accelerated code with RAPIDS 24.12, enabling me to handle dataframes with dask-cudf. RAPIDS Installation with Conda successful, test code works as it should.

    Now I would like to install a specific python library: ta-lib, to the venv.

    Procedure: (and no, I can’t use pip or conda because, loads of reasons and my grampa has a toothache… I have to build it from source. Moving on...:)

    Prep: create venv with : python3 -m venv <myenvpath> as usual


    1. login to venv: Correct syntax to activate venv in ubuntu shell:
      <<<< source ~/miniforge3/envs/rapids-24.12/bin/activate >>>>>>>>>


    2. Download the library at: https://github.com/TA-Lib/ta-lib/archive/refs/tags/v0.6.4.tar.gz


    3. Gently place the library in /home/<username>/miniforge3/envs/rapids-24.12. If it squeaks, slap it and do it again.


    4. extract the tarball

      tar -xzf ta-lib-0.6.4-src.tar.gz


    5. cd to the resulting dir

      cd ta-lib-0.6.4


    6. run install script:

    Now, first:

    `./configure
    make
    sudo make install`


    .....will install the library to a default directory, and not the dir where my venv is housed. I tried that: ta-lib doesn't show up when i run pip list

    Also tried installing ta-lib into other dir than usr/local:

    cd to: cd ~/miniforge3/envs/rapids-24.12/ta-lib-0.6.4

    then run:

    ./configure --prefix=/home/<username>/miniforge3/envs/rapids-24.12
    make
    sudo make install


    This makes the installation proceed normally and everything works, as far as I can see from shell output, but when I run pip list, ta-lib is nowhere to be seen.

    All of this SUDO wrestling has made me tired and SUDO is winning? I’m all out of ideas. How do I proceeed with this?

    Continue reading...

Compartilhe esta Página