Join the community today
Register Now

how to install pyftsubset in Alma8?

Discussion in 'Forum software usage' started by modder, Dec 2, 2023.

  1. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    12:00 AM
  2. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    12:00 AM
    Ok. Searched the forum, found this:
    Run the commands:
    Code (Text):
    pip3 install fonttools
    pip3 install Brotli
    pip3 install Zopfli


    Then run the following commands to locate the program:
    Code (Text):
    updatedb
    locate pyftsubset
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,315
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    2:00 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    For Almalinux/Rocky Linux 8, python 3.6 is default and the linked above steps are applicable if you want to isolate your python installed software in virtual environment separate from system wide environment

    Install virtualenv and create a directory to house the python projects at /home/python_projects. You're telling virtualenv to create an environment with default python 3.6 binary /usr/bin/python3.6 and name the virtual environment as fonttools. Then using source command to activate the environment
    Code (Text):
    pip install virtualenv
    mkdir -p /home/python_projects
    cd /home/python_projects
    virtualenv -p /usr/bin/python3.6 fonttools
    source fonttools/bin/activate


    With the fonttools environment activated run the commands to update pip and install fonttools and dependencies.
    Code (Text):
    # pip doesn't like ccache so disable it
    export CC='gcc'
    export CXX="g++"
    
    # pip needs a tmp directory that doesn't have noexec restrictions
    mkdir -p /home/piptmp
    chmod 1777 /home/piptmp
    export TMPDIR=/home/piptmp
    
    python3.6 -m pip install -U pip
    pip --version
    python3.6 -m pip install fonttools --verbose --force
    python3.6 -m pip install zopfli --verbose --force
    python3.6 -m pip install brotli --verbose --force

    You can find where pyftsubset was installed via locate command and you can see it was
    Code (Text):
    updatedb
    locate pyftsubset
    /home/python_projects/fonttools/bin/pyftsubset
     
  4. modder

    modder Member

    117
    16
    18
    Dec 6, 2019
    Ratings:
    +27
    Local Time:
    12:00 AM
    Thanks. What if I've already installed it with the commands in my previous post? How do I remove it before following your instructions?

    Or, is it really necessary to isolate the environment?
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,315
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    2:00 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    just run commands but instead use uninstall
    Code (Text):
    pip3 uninstall fonttools
    pip3 uninstall Brotli
    pip3 uninstall Zopfli
    

    Depends on what you're installing. For these 3 probably be fine, but getting into habit of virtual environments makes it cleaner. Google search for python virtualenv and read up on why and how.
     
  6. MaximilianKohler

    MaximilianKohler Member

    197
    5
    18
    Jun 23, 2023
    Ratings:
    +29
    Local Time:
    8:00 AM
    Does the same apply for EL9? We install python 3.6 in a virtual environment using the commands here? I'm guessing not.

    Code:
    updatedb
    locate pyftsubset
    Results in a blank output.
    Code:
    pip --version
    pip 24.1.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
    
    Would I do the same commands except change all instances of "python3.6" to "python3.9"?
     
    Last edited: Jul 22, 2024
  7. eva2000

    eva2000 Administrator Staff Member

    54,315
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    2:00 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  8. MaximilianKohler

    MaximilianKohler Member

    197
    5
    18
    Jun 23, 2023
    Ratings:
    +29
    Local Time:
    8:00 AM
    Thank you! It might be a good idea to clarify that the
    Code:
    ls -lAhrt fonts/fa
    command is actually
    Code:
    ls -lAhrt /home/nginx/domains/forum.domain.com/public/styles/fonts/fa