I have already installed geos library using brew install geos, but I'm still getting following error on mac M1.
./geos.h:1:10: fatal error: 'geos_c.h' file not found
#include <geos_c.h>
^~~~~~~~~~
1 error generated.
I believe it is because brew doesn't install the header packages. You can build from source.
This is what I did to solve it:
brew install wget
wget http://download.osgeo.org/geos/geos-3.3.8.tar.bz2
tar -xvf geos-3.3.8.tar.bz2
And run ./configure, make, and sudo make install in the extracted directory.
Related
I wanted to install package gdal on my Mac. I ran arch -x86_64 brew install gdal. However, it returned this error:
Error: /usr/local/Cellar/xz/5.2.4 is not a valid keg
You need to run brew update before the gdal installation, the latest xz is 5.4.1.
If still does not work, can you also update the OP and include brew config and brew doctor outputs?
I am trying to follow this website to install opencv4 on Ubuntu 18.04.
https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/
But I get this error after make
In file included from /home/gosztolai/opencv/3rdparty/libpng/pngpriv.h:913:0,
from /home/gosztolai/opencv/3rdparty/libpng/png.c:14:
/home/gosztolai/opencv/3rdparty/libpng/pngstruct.h:30:10: fatal error: zlib.h: No such file or directory
#include "zlib.h"
I tried sudo apt install zlib1g-dev but the system says that it is already isntalled
Could someone help what is going on?
libpng uses the zlib library for image compression. To install it in Ubuntu, run the following code in your bash terminal:
sudo apt-get install zlib1g-dev
But because you already have it installed, and need a newer version, you need to update the library. Try to upgrade your packages, using this code:
sudo apt update
sudo apt upgrade -y
Or you can try to remove it using apt and install again.
I have been trying to install ImageMagick in Ubuntu 16.04 to use with movie.py
I have installed ImageMagick 7 but when I check the version from the command line
convert --version
It gives error as
convert: error while loading shared libraries: libMagickCore-7.Q16HDRI.so.6: cannot open shared object file: No such file or directory
I also tried running
sudo ldconfig /user/local/lib
But, still getting same error.
Edit 2: How I installed
Downloaded two rpm files from imagemagick.org
run following commands to install in Ubuntu 16.04
sudo alien -i ImageMagick-libs-7.0.7-37.x86_64.rpm
sudo alien -i ImageMagick-7.0.7-37.x86_64.rpm
You may need to run this: ldconfig /usr/local/lib
Found that the LD_LIBRARY_PATH variable isn't being created by the installation of ImageMagick, so when I created it manually (on Linux Mint 19) -
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
Then the ImageMagick commands work, without generating the error message -
convert: error while loading shared libraries: libMagickCore-7.Q16HDRI.so.6: cannot open shared object file: No such file or directory
I also encountered this error when attempting to install ImageMagick 7.0.10 on Ubuntu 20.04 (using WSL on Windows 10).
Running this fixed my problem:
sudo ldconfig /usr/lib64
I found this folder by examining the deb:
dpkg -c imagemagick-libs_7.0.10-57_amd64.deb | grep libMagickCore-7.Q16HDRI.so.8
This showed:
lrwxrwxrwx root/root 0 2021-01-09 09:59 ./usr/lib64/libMagickCore-7.Q16HDRI.so.8 -> libMagickCore-7.Q16HDRI.so.8.0.0
I would suggest you find where the missing library is located:
sudo find /usr /opt / -type f -name libMagickCore-7.Q16HDRI.so.6
Then check your ldconfig settings match in:
/etc/ld.so.conf
What worked for me:
Uninstall native version (if you have installed from tar.gz)
cd ImageMagick-7.1.0-19/
sudo make uninstall
Remove apt version
sudo apt remove imagemagick
sudo apt purge imagemagick
Do simple install
sudo apt install imagemagick
Running
$ brew doctor
gives me:
Unexpected dylibs:
/usr/local/lib/libusb-1.0.0.dylib
According to this Linking libusb in Mac OS X I should run brew upgrade libusb however when doing so I get:
$ brew upgrade libusb
Error: No such file or directory - /usr/local/Cellar/libusb
Any suggestions how I upgrade? Or, simpler, to uninstall if it's not necessary. What's it used for?
I'm trying to install gdal via homebrew so I can start working with topojson, but I keep getting this error and I'm not sure how to resolve it?
k-6177:Cellar k$ brew install gdal
==> Installing dependencies for gdal: libpng, giflib, libtiff, lzlib, proj, libgeotiff, geos, sqlite, freexl, libxml2, json-c, liblwgeom, libspatialite
Error: Cannot link libpng
Another version is already linked: /usr/local/Cellar/libpng/1.6.16
Looks like I just needed to change some permissions. I used the following command:
sudo chown -R $(whoami):admin /usr/local
I did brew unlink libpng (or any other "already linked" package).