Failed to install PyTables - python

I'm trying to install PyTables using either easy_install or pip but both attempts end with the same error:
error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DNDEBUG=1 -DHAVE_LZO2_LIB=1 -DHAVE_BZ2_LIB=1 -Iblosc -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -c src/H5ARRAY.c -o build/temp.linux-x86_64-2.7/src/H5ARRAY.o -Isrc -DH5_USE_16_API" failed with exit status 1
I have all dependencies installed.
Found numexpr 1.4.2 package installed.
Found Cython 0.14.1 package installed.
Found HDF5 headers at /usr/include, library at /usr/lib.
Found LZO 2 headers at /usr/include, library at /usr/lib.
Skipping detection of LZO 1 since LZO 2 has already been found.
Found bzip2 headers at /usr/local/include, library at /usr/local/lib.
but there is still a warning:
.. WARNING:: Could not find the bzip2 runtime. The bzip2 shared library was *not* found in the default library paths. In case of runtime problems, please remember to install it.
Is it possible that this warning prevents successfully installing PyTables?

try to add this:
-I/usr/include/mpi

Related

cffi installation got failure on MacOs 12.5 with pip

I am trying to install "cffi" with pip on MacOs 12.5 but I got an error
python : 3.8.10
pip : 22.2.2
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Command :
pip install cffi
Error
/opt/homebrew/bin/gcc-11 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/libffi/include -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/opt/homebrew/Cellar/libffi/3.4.2/include -I/Users/faraz/.pyenv/versions/3.8.10/include/python3.8 -c c/_cffi_backend.c -o build/temp.macosx-12.5-arm64-3.8/c/_cffi_backend.o -iwithsysroot/usr/include/ffi
gcc-11: error: unrecognized command-line option '-iwithsysroot/usr/include/ffi'
error: command '/opt/homebrew/bin/gcc-11' failed with exit status 1
I also did some tips which mentioned in the following link but it didn't work for me.
pip cffi package installation failed on osx
After reading cffi documents, I find out that,"/opt/homebrew/bin/gcc-11" is gcc, and not clang and cffi doesn't explicitly support gcc on MacOS.
So, I added the following lines to ~/.bash_profile and it worked
# Set Clang as the default compiler for the system
export CC=clang
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

/usr/bin/ld: cannot find -lffi while installing cffi 1.11.5 package

enter code hereI'm trying to install paramiko module in my linux server. The pip is blocked on the server, So i am manually copying the package zips and installing them from setup.py
when i try installing paramiko i get
error: Could not find suitable distribution for Requirement.parse('pynacl>=1.0.1')
so i download the PyNaCl package, but i get
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('cffi>=1.1.0')
pynacl needs cffi 1.1.0 above:
so while installing cffi1.11.5 i get the below error:
[root#homecffi-1.11.5]# python3.5 setup.py install
running install
---
---
installing library code to build/bdist.linux-x86_64/egg
--
--
building '_cffi_backend' extension
gcc -pthread -fno-strict-aliasing -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/local/lib/libffi-3.1/include -I/usr/local/include/python3.5m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.5/c/_cffi_backend.o
c/_cffi_backend.c: In function ‘b_callback’:
c/_cffi_backend.c:5911: warning: ‘ffi_prep_closure’ is deprecated (declared at /usr/local/include/ffi.h:341)
gcc -pthread -shared build/temp.linux-x86_64-3.5/c/_cffi_backend.o -L$(libdir)/../lib64 -lffi -o build/lib.linux-x86_64-3.5/_cffi_backend.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lffi
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Can anyone help me with this?
If this is a Debian or Ubuntu machine,
sudo apt install libffi-dev
and then try again.
For other distributions, the installation method and package name may be different.

No OCR tool found in python

I have downloaded Mayan EDMS-Electronic Document Management System from GitHub and I configured project using Django server. I had added the required libraries based on requirement. Now the project runs with error
ocr.exceptions.OCRError: No OCR tool found
When I searched this error, I found Pyocr looks for the OCR tools (Tesseract, Cuneiform, etc) installed on your system and just tells you what it has found.
Then I tried to install tesseract using the command -->pip install tesseract-ocr.
I got this error
Requirement already satisfied: cython in ./venv2/lib/python2.7/site-packages (from tesseract-ocr) (0.28.4)
running bdist_wheel
running build
running build_py
file tesseract_ocr.py (for module tesseract_ocr) not found
file tesseract_ocr.py (for module tesseract_ocr) not found
running build_ext
building 'tesseract_ocr' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-l1RrwO/python2.7-2.7.14=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c tesseract_ocr.cpp -o build/temp.linux-x86_64-2.7/tesseract_ocr.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
tesseract_ocr.cpp:600:10: fatal error: leptonica/allheaders.h: No such file or directory
#include "leptonica/allheaders.h"
please help me to solve this issue. Thanks in advance.
Tesseract is installed on the OS using the apt-get command. The command you are using (PIP) is for installing Python packages, that is the reason for the error.
For reference: http://docs.mayan-edms.com/en/stable/topics/deploying.html#deploying
If using a Debian or Ubuntu based Linux distribution, get the executable requirements using:
sudo apt-get install g++ gcc ghostscript gnupg1 graphviz libjpeg-dev libmagic1 \
libpq-dev libpng-dev libreoffice libtiff-dev poppler-utils postgresql \
python-dev python-pip python-virtualenv redis-server sane-utils supervisor \
tesseract-ocr zlib1g-dev -y

How to install GNU MPFR library on pythonanywhere

I'm trying to install bigfloat and I am getting this message that seems to indicate I need the mpfr library first. How do I do this?
The message:
running build_ext building 'mpfr' extension creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c mpfr. c -o build/temp.linux-x86_64-2.7/mpfr.o mpfr.c:344:18: fatal error: mpfr.h: No such file or directory #include "mpfr.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I'm pretty new to python and pythonanywhere, so I don't know how to install libraries.
I tried to find how to install a library using google, and I tried to use:
pip install --user mpfr
but I get this error message:
Collecting mpfr Could not find a version that satisfies the requirement mpfr (from versions: ) No matching distribution found for mpfr
The gmpy2 is written in C and depends on three other C libraries: GMP, MPFR, and MPC. The easiest way to ensure all the dependencies are present is to "libmpc-dev" using the standard package management tools from your Linux distribution.
For example:
sudo apt-get install libmpc-dev

Pygame - smpeg does not find Python headers

I've been trying to install Pygame for days now, and the only dependency missing is smpeg. I get the following output:
brew install --HEAD smpeg
==> Installing dependencies for smpeg: gobject-introspection, gdk-pixbuf,
==> Installing smpeg dependency: gobject-introspection
==> Building source; bottle blocked by python requirement
==> Downloading http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.4
Already downloaded: /Library/Caches/Homebrew/gobject-introspection-1.40.0.tar.xz
==> ./configure --prefix=/usr/local/Cellar/gobject-introspection/1.40.0
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/sitepackages
checking for headers required to compile python extensions... ./configure: line 14647: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/pytho n-config: No such file or directory
not found
configure: error: Python headers not found
I've also tried to brew edit smpeg, adding include.install Dir["*.h"] above the two end at the end of the code, but to no avail.
My brew doctor says:
Warning: Python is installed at /Library/Frameworks/Python.framework
Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.
My brew list says:
autoconf git libgcrypt mpfr sdl_mixer
automake glib libgpg-error pkg-config sdl_ttf
cloog gmp libmpc portmidi tree
cmake gnu-getopt libpng pwgen webp
freetype isl libtiff sdl xz
gettext jpeg libtool sdl_gfx
gfortran libffi mercurial sdl_image
brew --config:
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: 7448fd1532ae1c1709fe2f03ffe0dc188a134b3e
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
X11: 2.7.5 => /opt/X11
brew was updated and upgraded
I have Python 2.7.6
Later I've managed to install smpeg.h (and MPEGfilter.h) in Python.framework/Versions/2.7/include/python and now when I run python setup.py install from cd pygame-1.9.1release, I get:
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/movie.c -o build/temp.macosx-10.3-fat-2.7/src/movie.o
In file included from src/movie.c:26:
In file included from src/pygame.h:106:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL.h:30:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_main.h:26:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_stdinc.h:30:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_config.h:34:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_config_macosx.h:29:
/usr/include/AvailabilityMacros.h:110:14: warning: Building for Intel with Mac
OS X Deployment Target < 10.4 is invalid. [-W#warnings]
#warning Building for Intel with Mac OS X Deployment Target ...
^
1 warning generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -g build/temp.macosx-10.3-fat-2.7/src/movie.o -ls -lm -lp -le -lg -o build/lib.macosx-10.3-fat-2.7/pygame/movie.so -framework SDL -F/Library/Frameworks/
ld: library not found for -ls
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
got it. did this: inside 'pygame-1.9.1release', 'cd src, emacs scale_mmx64.c'. there I looked for all occurrences of 'movsxl' and replaced them (two) with with 'movslq'. then 'sudo pip install hg+http://bitbucket.org/pygame/pygame worked'.

Categories

Resources