- Ошибка установки opencv-python Termux
- YTreWQ
- YTreWQ
- Вложения
- billy_605
- YTreWQ
- billy_605
- YTreWQ
- billy_605
- YTreWQ
- pip install matplotlib does not work under termux (Android)
- 5 Answers 5
- pip install lxml fails #3793
- Comments
- conspiracytheory commented May 11, 2019
- conspiracytheory commented May 11, 2019
- Grimler91 commented May 11, 2019
Ошибка установки opencv-python Termux
YTreWQ
Member
А какая версия python и pip установлена?
python -V
pip3 -V
Возможно стоит запускать установку от конкретной версии.
YTreWQ
Member
А какая версия python и pip установлена?
python -V
pip3 -V
Возможно стоит запускать установку от конкретной версии.
Вложения
billy_605
Короче, выполняеш все эти команды, прям все команды даже первую(установку питона):
1. pkg install python python-dev # установка питона
2. pkg install libjpeg-turbo-dev libpng-dev cmake pkg-config # установка нужных компонентов
3. git clone [URL]https://github.com/opencv/opencv[/URL] && cd opencv # качаеш пакет opencv из гитхаба, после установки пакета, комманда *&& cd opencv* автоматом зайдет в папку папку opencv
4. mkdir build && cd build # создаеш папку и открываеш его(папку)
5. LDFLAGS=» -llog -lpython3″ cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_opencv_python3=on -DBUILD_opencv_python2=off -DWITH_QT=OFF -DWITH_GTK=OFF .. # ставиш эту комманду
6. make # выполняеш
7. make install # устанавливаеш
YTreWQ
Member
Короче, выполняеш все эти команды, прям все команды даже первую(установку питона):
1. pkg install python python-dev # установка питона
2. pkg install libjpeg-turbo-dev libpng-dev cmake pkg-config # установка нужных компонентов
3. git clone [URL]https://github.com/opencv/opencv[/URL] && cd opencv # качаеш пакет opencv из гитхаба, после установки пакета, комманда *&& cd opencv* автоматом зайдет в папку папку opencv
4. mkdir build && cd build # создаеш папку и открываеш его(папку)
5. LDFLAGS=» -llog -lpython3″ cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_opencv_python3=on -DBUILD_opencv_python2=off -DWITH_QT=OFF -DWITH_GTK=OFF .. # ставиш эту комманду
6. make # выполняеш
7. make install # устанавливаеш
$pkg install python python-dev
Checking availability of current mirror: ok
Reading package lists. Done
Building dependency tree
Reading state information. Done
Package python-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python
E: Package ‘python-dev’ has no installation candidate
billy_605
$pkg install python python-dev
Checking availability of current mirror: ok
Reading package lists. Done
Building dependency tree
Reading state information. Done
Package python-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python
E: Package ‘python-dev’ has no installation candidate
Попробуй отделнeю установку:
1. pkq install python-dev
Если не будет, работать попробуй выполнить осталние команды.
YTreWQ
Member
Попробуй отделнeю установку:
1. pkq install python-dev
Если не будет работать попробуй выполнить осталние команды
billy_605
YTreWQ
Member
$ LDFLAGS=» -llog -lpython3″ cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_opencv_python3=on -DBUILD_opencv_python2=off -DWITH_QT=OFF -DWITH_GTK=OFF ..
— The CXX compiler identification is Clang 10.0.1
— The C compiler identification is Clang 10.0.1
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info — done
— Check for working CXX compiler: /data/data/com.termux/files/usr/bin/c++ — skipped
— Detecting CXX compile features
— Detecting CXX compile features — done
— Detecting C compiler ABI info
— Detecting C compiler ABI info — done
— Check for working C compiler: /data/data/com.termux/files/usr/bin/cc — skipped
— Detecting C compile features
— Detecting C compile features — done
— Detected processor: aarch64
— Found PythonInterp: /data/data/com.termux/files/usr/bin/python (found suitable version «3.8.5», minimum required is «2.7»)
CMake Warning at cmake/OpenCVDetectPython.cmake:81 (message):
CMake’s ‘find_host_package(PythonInterp 2.7)’ found wrong Python version:
Consider providing the ‘PYTHON2_EXECUTABLE’ variable via CMake command line
or environment variables
Источник
pip install matplotlib does not work under termux (Android)
I installed termux on my Android tablet, and was able to successfully install Python 3.9 and Numpy, but not matplotlib. Apparently the .whl was downloaded and cached, and now when I try to install, whether using pip or pkg it attempts to use the cached .whl file. I tried clearing memory and reinstalling everything from scratch, but it still downloads the same .whl, with the same result. (The termux wiki provided no clues that I could find) Anybody have a work around or fix?
5 Answers 5
As listed in termux wiki.
As I did not want to install Ubuntu on the tablet, what I wound up doing was installing Pydroid 3. I was then able to install Numpy and Matplotlib using pip. Thanks for the effort!
1- Install Ubuntu for termux from the link below (follow the steps) https://github.com/MFDGaming/ubuntu-in-termux
2- Install python3 and pip3 as you would do normally in Ubuntu (don’t need to use ‘sudo’ as you are logged as the root).
3- Install matplotlib and the other packages, like jupyter etc using pip3.
I had the same issue, but the existing answers did not work for me. In my case, it turned out to be an issue with installing Pillow. If «pip install Pillow» does not work, you may have the same issue.
To fix it, follow the image editor installation instructions for Pillow given on the Termux wiki. Look at the Python section of this page: https://wiki.termux.com/wiki/Image_Editors. After that «pip install matplotlib» worked without issue.
Part of the answer that worked for me is given by Krishna Kanhaya and Garam Lee. However I had to make some changes to the sed command, which are also not listed in the termux wiki:
Be sure to install all dependencies as described in the wiki. Follow the answer by Krishna Kanhaya/the workaround from the wiki.
Replace the line from answer by Krishna Kanhaya or the wiki.
sed ‘s@#enable_lto = True@enable_lto = False@g’ setup.cfg.template > setup.cfg with
sed ‘s/#enable_lto = True/enable_lto = False/g’ mplsetup.cfg.template > mplsetup.cfg
It will create a copy of template setup file and changes the enable_lto = True to enable_lto = False and rename it to mplsetup.cfg.
You can access mplsetup.cfg.template in beforehand with e.g.
to read the instructions there.
I don’t know why I had to make these changes. Maybe they changed the name of the setup file for matplotlib with a newer version?
In the end check if the line enable_lto = False
Источник
pip install lxml fails #3793
Comments
conspiracytheory commented May 11, 2019
pip install lxml fails with the following error:-
running setup.py install for lxml . error
ERROR: Complete output from command /data/data/com.termux/files/usr/bin/python -u -c ‘import setuptools, tokenize;file='»‘»‘/data/data/com.termux/files/usr/tmp/pip-install-fe2wm8xs/lxml/setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file);code=f.read().replace(‘»‘»‘\r\n'»‘»‘, ‘»‘»‘\n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /data/data/com.termux/files/usr/tmp/pip-record-y296du61/install-record.txt —single-version-externally-managed —compile:
ERROR: Building lxml version 4.3.3.
Building without Cython.
Using build configuration of libxslt 1.1.33
Building against libxml2/libxslt in the following directory: /data/data/com.termux/files/usr/lib
running install
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.7
creating build/lib.linux-aarch64-3.7/lxml
copying src/lxml/sax.py -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/usedoctest.py -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/init.py -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/cssselect.py -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/_elementpath.py -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/builder.py -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.linux-aarch64-3.7/lxml
creating build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/init.py -> build/lib.linux-aarch64-3.7/lxml/includes
creating build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/defs.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/diff.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/builder.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/clean.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/init.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.linux-aarch64-3.7/lxml/html
copying src/lxml/html/formfill.py -> build/lib.linux-aarch64-3.7/lxml/html
creating build/lib.linux-aarch64-3.7/lxml/isoschematron
copying src/lxml/isoschematron/init.py -> build/lib.linux-aarch64-3.7/lxml/isoschematron
copying src/lxml/etree.h -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/etree_api.h -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/lxml.etree.h -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.linux-aarch64-3.7/lxml
copying src/lxml/includes/xinclude.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/init.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.linux-aarch64-3.7/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.linux-aarch64-3.7/lxml/includes
creating build/lib.linux-aarch64-3.7/lxml/isoschematron/resources
creating build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/rng
creating build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl
creating build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-aarch64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building ‘lxml.etree’ extension
creating build/temp.linux-aarch64-3.7
creating build/temp.linux-aarch64-3.7/src
creating build/temp.linux-aarch64-3.7/src/lxml
aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Oz -Oz -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -I/data/data/com.termux/files/usr/include -I/data/data/com.termux/files/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/data/data/com.termux/files/usr/include/python3.7m -c src/lxml/etree.c -o build/temp.linux-aarch64-3.7/src/lxml/etree.o -w
In file included from src/lxml/etree.c:687:
In file included from src/lxml/includes/etree_defs.h:186:
In file included from /data/data/com.termux/files/usr/include/libxml2/libxml/tree.h:1307:
In file included from /data/data/com.termux/files/usr/include/libxml2/libxml/xmlmemory.h:218:
In file included from /data/data/com.termux/files/usr/include/libxml2/libxml/threads.h:35:
In file included from /data/data/com.termux/files/usr/include/libxml2/libxml/globals.h:18:
In file included from /data/data/com.termux/files/usr/include/libxml2/libxml/parser.h:810:
/data/data/com.termux/files/usr/include/libxml2/libxml/encoding.h:28:10: fatal error: ‘iconv.h’ file not found
#include
^
1 error generated.
Compile failed: command ‘aarch64-linux-android-clang’ failed with exit status 1
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
cc -I/data/data/com.termux/files/usr/include -I/data/data/com.termux/files/usr/include/libxml2 -I/usr/include/libxml2 -c /data/data/com.termux/files/usr/tmp/xmlXPathInitmcb084gu.c -o data/data/com.termux/files/usr/tmp/xmlXPathInitmcb084gu.o
In file included from /data/data/com.termux/files/usr/tmp/xmlXPathInitmcb084gu.c:1:
In file included from /data/data/com.termux/files/usr/include/libxml2/libxml/xpath.h:26:
In file included from /data/data/com.termux/files/usr/include/libxml2/libxml/xmlerror.h:10:
In file included from /data/data/com.termux/files/usr/include/libxml2/libxml/parser.h:810:
/data/data/com.termux/files/usr/include/libxml2/libxml/encoding.h:28:10: fatal error: ‘iconv.h’ file not found
#include
^
1 error generated.
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command ‘aarch64-linux-android-clang’ failed with exit status 1
—————————————-
ERROR: Command «/data/data/com.termux/files/usr/bin/python -u -c ‘import setuptools, tokenize;file='»‘»‘/data/data/com.termux/files/usr/tmp/pip-install-fe2wm8xs/lxml/setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file);code=f.read().replace(‘»‘»‘\r\n'»‘»‘, ‘»‘»‘\n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ install —record /data/data/com.termux/files/usr/tmp/pip-record-y296du61/install-record.txt —single-version-externally-managed —compile» failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-install-fe2wm8xs/lxml/
The text was updated successfully, but these errors were encountered:
conspiracytheory commented May 11, 2019
I have already installed clang, libxml2, libxml2-dev, libxslt & libxslt-dev.
Output of termux-info:
termux-info
Updatable packages:
All packages up to date
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://dl.bintray.com/termux/termux-packages-24 stable/main
System information:
Linux localhost 4.4.153-perf+ #1 SMP PREEMPT Thu Apr 11 11:14:12 WIB 2019 aarch64 Android
Termux-packages arch:
aarch64
Android version:
9
Device manufacturer:
Xiaomi
Device model:
Mi A2
Grimler91 commented May 11, 2019
iconv.h is found in libiconv-dev.
If you get an error that a file is missing then googling for that file can probably tell you which package to install.
Источник