Skip to content
Advertisement

error: [Errno 13] Permission denied: ‘./configure’ when use pip3 install matplotlib on termux

I’m newbie
I tried to install the matplotlib package using pip but got this error

python: 3.9.0
pip: 20.2.4

$ pip3 install matplotlib
Collecting matplotlib
  Using cached matplotlib-3.3.2.tar.gz (37.9 MB)
Requirement already satisfied: certifi>=2020.06.20 in ./files/usr/lib/python3.9/site-packages (from matplotlib) (2020.6.20)
Requirement already satisfied: cycler>=0.10 in ./files/usr/lib/python3.9/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in ./files/usr/lib/python3.9/site-packages (from matplotlib) (1.2.0)
Requirement already satisfied: numpy>=1.15 in ./files/usr/lib/python3.9/site-packages (from matplotlib) (1.19.3)
Requirement already satisfied: pillow>=6.2.0 in ./files/usr/lib/python3.9/site-packages (from matplotlib) (8.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in ./files/usr/lib/python3.9/site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: python-dateutil>=2.1 in ./files/usr/lib/python3.9/site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: six in ./files/usr/lib/python3.9/site-packages (from cycler>=0.10->matplotlib) (1.15.0)
Building wheels for collected packages: matplotlib                                                                                             Building wheel for matplotlib (setup.py) ... error                                                                                           ERROR: Command errored out with exit status 1:                                                                                                command: /data/data/com.termux/files/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-zejjxir0/matplotlib/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-zejjxir0/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /data/data/com.termux/files/usr/tmp/pip-wheel-6cp2oysk                                              cwd: /data/data/com.termux/files/usr/tmp/pip-install-zejjxir0/matplotlib/                                                               Complete output (580 lines):                                                                                                                                                                                                                                                              Edit setup.cfg to change the build options; suppress output with --quiet.

  BUILDING MATPLOTLIB                                                                                                                            matplotlib: yes [3.3.2]                                                                                                                          python: yes [3.9.0 (default, Oct  8 2020, 15:54:02)  [Clang 9.0.8                                                                                        (https://android.googlesource.com/toolchain/llvm-project                                                                                     98c855489]                                                                                                                     platform: yes [linux]                                                                                                                     sample_data: yes [installing]                                                                                                                      tests: no  [skipping due to configuration]                                                                                                  macosx: no  [Mac OS-X only]                                                                                                                                                                                                                                                         running bdist_wheel                                                                                                                          running build                                                                                                                                running build_py                                                                                                                             creating build                                                                                                                               creating build/lib.linux-aarch64-3.9                                                                                                         copying lib/pylab.py -> build/lib.linux-aarch64-3.9                                                                                          creating build/lib.linux-aarch64-3.9/matplotlib                                                                                              copying lib/matplotlib/__init__.py -> build/lib.linux-aarch64-3.9/matplotlib                                                                 copying lib/matplotlib/_animation_data.py -> build/lib.linux-aarch64-3.9/matplotlib                                                          copying lib/matplotlib/_cm.py -> build/lib.linux-aarch64-3.9/matpl
...
...
copying lib/matplotlib/mpl-data/sample_data/membrane.dat -> build/lib.linux-aarch64-3.9/matplotlib/mpl-data/sample_data
  UPDATING build/lib.linux-aarch64-3.9/matplotlib/_version.py
  set build/lib.linux-aarch64-3.9/matplotlib/_version.py to '3.3.2'
  running build_ext
  creating data
  creating data/data
  creating data/data/com.termux
  creating data/data/com.termux/files
  creating data/data/com.termux/files/usr
  creating data/data/com.termux/files/usr/tmp
  aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -Wno-deprecated-declarations -Wno-unreachable-code -fPIC -I/data/data/com.termux/files/usr/include/python3.9 -c /data/data/com.termux/files/usr/tmp/tmpf47ko78k.cpp -o data/data/com.termux/files/usr/tmp/tmpf47ko78k.o -fvisibility=hidden
  aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -Wno-deprecated-declarations -Wno-unreachable-code -fPIC -I/data/data/com.termux/files/usr/include/python3.9 -c /data/data/com.termux/files/usr/tmp/tmp4auaqklr.cpp -o data/data/com.termux/files/usr/tmp/tmp4auaqklr.o -fvisibility-inlines-hidden
  Extracting freetype-2.6.1.tar.gz
  Building freetype in build/freetype-2.6.1
  error: [Errno 13] Permission denied: './configure'
  ----------------------------------------
  ERROR: Failed building wheel for matplotlib
  Running setup.py clean for matplotlib
Failed to build matplotlib
Installing collected packages: matplotlib
    Running setup.py install for matplotlib ... error
    ERROR: Command errored out with exit status 1:
     command: /data/data/com.termux/files/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-3w4igc1k/matplotlib/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-3w4igc1k/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-jffs1p2w/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/usr/include/python3.9/matplotlib
         cwd: /data/data/com.termux/files/usr/tmp/pip-install-3w4igc1k/matplotlib/
    Complete output (572 lines):

    Edit setup.cfg to change the build options; suppress output with --quiet.

    BUILDING MATPLOTLIB
      matplotlib: yes [3.3.2]
          python: yes [3.9.0 (default, Oct  8 2020, 15:54:02)  [Clang 9.0.8
                      (https://android.googlesource.com/toolchain/llvm-project
                      98c855489]
        platform: yes [linux]
     sample_data: yes [installing]
           tests: no  [skipping due to configuration]
          macosx: no  [Mac OS-X only]

    running install
    running build
    running build_py
    creating build/lib.linux-aarch64-3.9
    copying lib/pylab.py -> build/lib.linux-aarch64-3.9
    creating build/lib.linux-aarch64-3.9/matplotlib
    copying lib/matplotlib/__init__.py -> build/lib.linux-aarch64-3.9/matplotlib
    copying lib/matplotlib/_animation_data.py -> build/lib.linux-aarch64-3.9/matplotlib
    copying lib/matplotlib/_cm.py -> build/lib.linux-aarch64-3.9/matplotlib
...
...
copying lib/matplotlib/mpl-data/images/zoom_to_rect.png -> build/lib.linux-aarch64-3.9/matplotlib/mpl-data/images
    copying lib/matplotlib/mpl-data/sample_data/README.txt -> build/lib.linux-aarch64-3.9/matplotlib/mpl-data/sample_data
    UPDATING build/lib.linux-aarch64-3.9/matplotlib/_version.py           set build/lib.linux-aarch64-3.9/matplotlib/_version.py to '3.3.2'
    running build_ext                                                     aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -Wno-deprecated-declarations -Wno-unreachable-code -fPIC -I/data/data/com.termux/files/usr/include/python3.9 -c /data/data/com.termux/files/usr/tmp/tmp8gd5nxqf.cpp -o data/data/com.termux/files/usr/tmp/tmp8gd5nxqf.o -fvisibility=hidden
    aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -Wno-deprecated-declarations -Wno-unreachable-code -fPIC -I/data/data/com.termux/files/usr/include/python3.9 -c /data/data/com.termux/files/usr/tmp/tmpfcioek2o.cpp -o data/data/com.termux/files/usr/tmp/tmpfcioek2o.o -fvisibility-inlines-hidden        Building freetype in build/freetype-2.6.1
    error: [Errno 13] Permission denied: './configure'
    ----------------------------------------                          ERROR: Command errored out with exit status 1: /data/data/com.termux/files/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-3w4igc1k/matplotlib/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-3w4igc1k/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-jffs1p2w/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/usr/include/python3.9/matplotlib Check the logs for full command output.

Is there a way to solve this problem? I followed the instructions of
https://wiki.termux.com/wiki/Python https://matplotlib.org/users/installing.html#installing-an-official-release but still got the error

Advertisement

Answer

i have fixed this by use this command

pkg install freetype pkg-config 
cd ~/../usr/include
pkg-config --cflags freetype2
pip3 install matplotlib
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement