[Python] How can I install the FeniCS dolfin module?

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

  1. Stack

    Stack Membro Participativo

    So I'm trying to install FEniCS from the instructions here. I did the

    pip3 install fenics-ffc --upgrade


    inside my virtualenv and it worked but when I try to import dolfin I get a ModuleNotFound error. I'm not sure how to get dolfin installed. I did

    pip install pybind11


    to get pybind11 installed then copied the code for dolfin installation into my cmd

    FENICS_VERSION=$(python3 -c"import ffc; print(ffc.__version__)")
    git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/dolfin
    git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/mshr
    mkdir dolfin/build && cd dolfin/build && cmake .. && make install && cd ../..
    mkdir mshr/build && cd mshr/build && cmake .. && make install && cd ../..
    cd dolfin/python && pip3 install . && cd ../..
    cd mshr/python && pip3 install . && cd ../..


    but it just spat out dozens of errors like:

    FENICS_VERSION=$(python3 -c"import ffc; print(ffc.version)") 'FENICS_VERSION' is not recognized as an internal or external command, operable program or batch file.

    git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/dolfin Cloning into 'dolfin'...

    fatal: Remote branch $FENICS_VERSION not found in upstream origin

    git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/mshr Cloning into 'mshr'...

    fatal: Remote branch $FENICS_VERSION not found in upstream origin

    There were lots more errors after too. Am I not supposed to paste the dolfin code into cmd? I don't know much about this stuff so unsure of how to get the dolfin module. I've previously only used pip to get my packages but this does not work for dolfin as it doesn't appear to be on PyPI.

    Continue reading...

Compartilhe esta Página