ImageMagick - command working on ubuntu but not centos - centos

Any idea why the following would work fine on ubuntu:
convert -background lightblue -fill blue -pointsize 14 label:123 test.jpg
but get this response on centos (7)
convert: not authorized `123' # error/constitute.c/ReadImage/454.
convert: no images defined `test.jpg' # error/convert.c/ConvertImageCommand/3046.
I have tried a few different versions on each.
Does it have anything to do with all of this.. which is missing in the centos one?
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
and if so, how can I install what is missing?
here is my centos version info: (from yum install ImageMagick)
$ convert --version
Version: ImageMagick 7.0.8-14 Q16 x86_64 2018-11-17 https://imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): zlib

Edit /etc/ImageMagick/policy.xml and comment out the "LABEL" line:
<!-- <policy domain="coder" rights="none" pattern="LABEL" /> -->
Don't ask me why this is disabled in CentOS. IM has some known vulnerabilities, and RHEL/CentOS are a bit on the paranoid side.

Related

ERROR: Could not find a version that satisfies the requirement tensorflow-data-validation (from versions: none)

I get this error with Python 3.7 and Windows 10 64-bit (which is supported).
It seems that there are only wheels for Windows for Python 3.5 and 3.6...
Thanks in advance.
pip install tensorflow-data-validation
Collecting tensorflow-data-validation
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement tensorflow-data-validation (from versions: none)
ERROR: No matching distribution found for tensorflow-data-validation
Software and versions
-Windows 10 Enterprise. 64-bit
-import sys
!{sys.executable} --version
Python 3.7.3
(Python 3.7 version (Anaconda 2019.07 for Windows Installer https://www.anaconda.com/distribution/ , Jupyter Notebook))
-Successfully installed pip-19.2.3 (pip --version)
-ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. (pip install apache-beam)
-Successfully installed tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0 (pip install tensorflow)
-Successfully installed pyarrow-0.14.0 (pip install pyarrow==0.14.*)
-https://www.tensorflow.org/tfx/data_validation/install (https://pypi.org/project/tensorflow-data-validation/)
Supported platforms
TFDV is tested on the following 64-bit operating systems:
Windows 7 or later.
verbose
pip install -v tensorflow-data-validation
Collecting tensorflow-data-validation
Analyzing links from page https://pypi.org/simple/tensorflow-data-validation/
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
[…]
Skipping link: none of the wheel's tags match: cp35-cp35m-win_amd64: files.pythonhosted.org/packages/d7/a1/b1f0c9c88713a60f206cf7bfaeb9391da1c9c8e3a6c98cd22078568777db/tensorflow_data_validation-0.14.0-cp35-cp35m-win_amd64.whl#sha256=eeff482c69ae1e49d84bbbef7c2ca058735e1d12cd640b643853f5f5fb05bc70 (requires-python:>=2.7,!=3.0.,!=3.1.,!=3.2.,!=3.3.,!=3.4.,<4)
Skipping link: none of the wheel's tags match: cp36-cp36m-win_amd64: files.pythonhosted.org/packages/bb/75/f3112982ca379481ae7706a94bf2755bd886fd4c8386e88ab978c5a0ae52/tensorflow_data_validation-0.14.0-cp36-cp36m-win_amd64.whl#sha256=611c23f718df87dcb6f34a6cf81d1a9699523254803607537e3d7e94e2c4712c (requires-python:>=2.7,!=3.0.,!=3.1.,!=3.2.,!=3.3.,!=3.4.,<4)
Skipping link: none of the wheel's tags match: cp35-cp35m-win_amd64: files.pythonhosted.org/packages/77/13/d0a90ccde514a4547b5d2ce3268f683aa6d5fb9f185c2b4d9a7db15eafca/tensorflow_data_validation-0.14.1-cp35-cp35m-win_amd64.whl#sha256=df5eb52ef53ee9db901aed5a30db183f272cda0a8b4f6981d9843cb6c52fc58a (requires-python:>=2.7,!=3.0.,!=3.1.,!=3.2.,!=3.3.,!=3.4.,<4)
Skipping link: none of the wheel's tags match: cp36-cp36m-win_amd64: files.pythonhosted.org/packages/54/3e/dec2c051d4a6dd04dcacfd73d4d02be3ad3cd56008ba2251e3bd8cc36adf/tensorflow_data_validation-0.14.1-cp36-cp36m-win_amd64.whl#sha256=2cba18c385d7de8d346b8db4b9bfec38e8535e1371a6a7f2f375ea51264dfeb8 (requires-python:>=2.7,!=3.0.,!=3.1.,!=3.2.,!=3.3.,!=3.4.,<4)
[…]
Given no hashes to check 0 links for project 'tensorflow-data-validation': discarding no candidates
PyPI Download Files
tensorflow_data_validation-0.14.1-cp35-cp35m-win_amd64.whl (1.7 MB)
Wheel cp35 Aug 22, 2019
tensorflow_data_validation-0.14.1-cp36-cp36m-win_amd64.whl (1.7 MB)
Wheel cp36 Aug 22, 2019
-https://pypi.org/project/tensorflow-data-validation/#modal-close
Works with Python 3.6.9 (e.g. Anaconda Navigator>Environments>Create)

Install Mapnik on Centos 7: ICU C++ Library Not Found

Problem/Introduction:
I'm trying to install Mapnik on Centos 7. I've had about a year UNIX experience in the professional environment, but I am still very much a beginner. I've compiled and installed boost which to my knowledge comes with ICU C++ Libraries. Unfortunately when I run ./configure for Mapnik installation I get the following error:
Exiting... the following required dependencies were not found:
- icuuc (ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/)
How do I install this library? I can't find any good internet resources, or maybe I'm looking in the wrong places.
Thanks in advance.
yum install freetype-devel libtool-ltdl-devel libpng-devel libtiff-devel libjpeg-devel gcc-c++ libicu-devel python-devel bzip2-devel boost libwebp-devel libtiff-devel libjpeg-turbo-devel libpng-devel sqlite-devel gdal-devel gdal-python
wget https://mapnik.s3.amazonaws.com/dist/v3.0.10/mapnik-v3.0.10.tar.bz2
tar -xf ./mapnik-v3.0.10.tar.bz2
cd ./mapnik-v3.0.10/
./configure
make && make install
Mapnik v3.0.10 needs Boost of minimum version v1.56
CentOS 7 is shipped with version v1.53

Graphviz Dot failing to remove overlaps due to missing library

I am trying to run the following dot command from the command line:
dot -v ~/Documents/FlowGraph/dot_sample_1_full.dot -Tpng 'Documents/FlowGraph/sampleOutput.png' -Ksfdp -Goverlap=false
but it is failing with this output:
dot - graphviz version 2.36.0 (20140111.2315)
Using render: cairo:cairo
Using device: png:cairo:cairo
libdir = "/usr/local/lib/graphviz"
Activated plugin library: libgvplugin_neato_layout.6.dylib
Using layout: sfdp:neato_layout
The plugin configuration file:
/usr/local/lib/graphviz/config6
was successfully loaded.
render : cairo dot fig map pic pov ps quartz svg tk vml xdot
layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
textlayout : textlayout
device : bmp canon cgimage cmap cmapx cmapx_np dot eps exr fig gif gv icns ico imap imap_np ismap jp2 jpe jpeg jpg pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz tga tif tiff tk vml vmlz x11 xdot xdot1.2 xdot1.4 xlib
loadimage : (lib) bmp eps gif jpe jpeg jpg pdf png ps svg
fontname: "Times-Roman" resolved to: (ps:pango Times, REGULAR) (PangoCairoCoreTextFont) "Times"
margin 8
pack info:
mode node
size 0
flags 0
ctrl->overlap=-1
Error: remove_overlap: Graphviz not built with triangulation library
I've Googled and found this thread, which suggested:
gts has to be installed before graphivz so enter 'sudo brew remove
graphviz' to remove graphivz and 'sudo brew install gts' and 'sudo
install graphivz' to install graphivz with gts.
but that didn't seem to work. I'm still getting the error so either I didn't do it right, or that wasn't the solution for me.
How do I add the triangulation library to graphviz?
I had a similar problem on macOS with sfdp and the following is what solved it.
$ brew uninstall graphviz
$ brew install gts
$ brew install --with-gts graphviz
Homebrew doesn't support command line install options anymore, so the previous answers will not work anymore.
However, by accident i discovered that removing graphviz, installing gts, then installing graphviz works. It seems that graphviz will use gts if it isnt installed, but for some reason, it isnt a dependency.
brew remove graphviz
brew install gts
brew install graphviz

pdftotext on Centos 6 64bit?

I have a HostGator VPS server, and want to be able to run pdftotext, part of xpdf (http://www.foolabs.com/xpdf/download.html).
After testing this out on my Mac, it worked fine, so I went to installing it on my VPS server.
I followed the installation instructions and it all isntalled flawlessly:
Copy the executables (xpdf, pdftotext, etc.) to to /usr/local/bin.
Copy the man pages (*.1 and *.5) to /usr/local/man/man1 and /usr/local/man/man5.
Copy the sample-xpdfrc file to /usr/local/etc/xpdfrc
Then I tested it out:
root#*** [~]# pdftotext
pdftotext: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by pdftotext)
So as you can see, it couldn't find /lib64/libc.so.6. /lib64/libc.so.6 is there, however, as shown by this:
root#*** [~]# /lib64/libc.so.6
GNU C Library stable release version 2.5, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-52).
Compiled on a Linux 2.6.9 system on 2012-03-19.
Available extensions:
The C stubs add-on version 2.1.2.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
GNU libio by Per Bothner
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
RT using linux kernel aio
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
I then contacted HostGator, where they told me that it will not work on my server, as it can't find /lib64/libc.so.6, and is therefor not available on Centos 6 64bit.
If this is indeed true, are there any alternatives to pdftotext that do a simple and fast conversion that would work on this server? Is it possible that the pdftotext can be complied for a different version, or that I installed it incorrectly with permissions?
Neither of these commands will work:
yum install xpdf
yum install poppler-utils
xpdf will install poppler-utils anyway and this will result in this pdftotext
pdftotext version 0.26.5
Copyright 2005-2014 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2011 Glyph & Cog, LLC
This is not the version you want. You want this one:
pdftotext version 4.03 [www.xpdfreader.com]
Copyright 1996-2021 Glyph & Cog, LLC
This will require going to www.xpdfreader.com and then clicking on "Download". Use the latest versions from this page to set up the newer pdftotext command.
I actually compiled the sources myself:
cd /tmp
wget https://dl.xpdfreader.com/xpdf-4.03.tar.gz
tar -xf xpdf-4.03.tar.gz
cd xpdf-4.03
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release
If successful you should see:
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/xpdf-4.03
Then just type:
make
It should end with:
[100%] Built target pdftotext
Then type
make install
Now when you type pdftotext you should see:
pdftotext version 4.03 [www.xpdfreader.com]
Copyright 1996-2021 Glyph & Cog, LLC
Note: I wrote all my code for pdftotext version 4.03. Took me a while to realise 4.03 and 0.26 produce vastly different results.

PIL selftest.py fails for Centos 6 64-bit Error: Jpeg Decoder not Available

I am having difficulty on my server trying to get the selftest.py to run successfully.
I am trying to get PIL 1.1.7 working with Python 2.4.4 (Are the versions compatible?)
When the install is preformed like so:
# python2.4 setup.py install
running install
running build
running build_py
running build_ext
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.4.6 (#1, Dec 21 2012, 14:54:30)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.
To check the build, run the selftest.py script.
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/pilconvert.py to 755
changing mode of /usr/local/bin/pilprint.py to 755
changing mode of /usr/local/bin/pilfile.py to 755
changing mode of /usr/local/bin/pilfont.py to 755
changing mode of /usr/local/bin/pildriver.py to 755
creating /usr/local/lib/python2.4/site-packages/PIL.pth
Everything seems handy dandy. Jpeg support is available and all is happy. But the selftest.py however is a different story:
# python2.4 /usr/local/src/Imaging-1.1.7/selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY rc/Imaging-1.1.7]# yum install libjpeg62-devel zlib1g-devel libfreetype6-devel liblcms1-develp
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
*** TKINTER support not installed
*** JPEG support not installed
*** ZLIB (PNG/ZIP) support not installed
--- FREETYPE2 support ok
*** LITTLECMS support not installed
--------------------------------------------------------------------
Running selftest:
*****************************************************************
Failure in example:
try:
_info(Image.open(os.path.join(ROOT, "Images/lena.jpg")))
except IOError, v:
print v
from line #24 of selftest.testimage
Expected: ('JPEG', 'RGB', (128, 128))
Got: decoder jpeg not available
1 items had failures:
1 of 57 in selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.
I get the dreaded Jpeg decoder not available.
I've tried a variety of things. I changed the setup to point to usr/lib64 that didn't work. I made some symbolic links in the usr/lib to point to the libjpeg.so file, that also didn't work. I went back and forth with the tech guys at our server hosting place and they aren't understanding the issue and it's like talking to a wall. I am really stuck. The only thing I haven't tried is the PiP but I didn't try that because I don't know how that works exactly. So I want to avoid that.
Is there a compatibility issue or a setting I just don't have quite right?
Thank you for the assistance.
--UPDATE--
Working on this problem again these days
I've tested Centos 5 & 6 32-bit And everything installs like a charm, but 64-bit I'm still having issues.
It seems like the selftest works with the stock python2.6 but not with python2.4. Pil 1.1.7 is compatable with 2.4.4 but I think there is a problem with the libraries in 64-bit. Still searching for a solution.
After extensive testing it's just not possible.
I'm sure it can be done but the steps it would require to get it down would be so intensive that it would make it difficult to gaurentee the stability of the server/system.
The problem really lies in the 64-bit system. The Python-Imagining would work with python 2.4 if python 2.4 was compiled as 32-bit. However even if you get Python-2.4 compiled into 32-bit it has a hard time with the libraries since everything in Centos is build for the 64 arch. And getting those additional libraries is cumbersome since the repos won't include the structures you need to get it working. It's just, annoying. It's not feasible to go hunting around in circles and the time spent trying to support such a limping system is wasted. And possibly puts the system at risk.
No, it's not possible to install PIL for Python 2.4 on a 64-bit machine.
In my case we had no support of all the libraries in PIL (CentOS 6, x64)
*** TKINTER support not available
*** JPEG support not available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
So we used following:
yum install freetype freetype-devel libpng libpng-devel libjpeg libjpeg-devel
And now we have
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
3 years later, I know, but this can work just fine! The standard build process will not look for libraries in /usr/lib64, but you can't specify a library path when running setup.py build, so you need to rebuild the binaries afterwards in a separate step:
yum install freetype-devel libpng-devel libjpeg-turbo-devel libzip-devel lcms-devel
pip download PIL
unzip pil-1.1.7.zip
cd pil-1.1.7
./setup.py build
./setup.py build_ext -L /usr/lib64/:/usr/local/lib64 --force
./setup.py install --prefix /usr/local/python27 --force --skip-build
This is on Scientific Linux 6.7 64-bit, using Python 2.7 compiled from source.