After installing ImageMagick, I cannot use it from the commandline - imagemagick

I installed ImageMagick using
$ sudo port install ImageMagick
However, when I run a basic command in a new terminal window, I get an error
$ convert logo.gif
-bash: convert: command not found
Why can't I run ImageMagick commands?
I've added ImageMagick to my path. See below for a bash profile:
#~/.bash_profile
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
export PATH="$MAGICK_HOME/bin:$PATH"
export MAGICK_HOME="$HOME/ImageMagick-6.8.9"
Note, I removed the above from my bash profile when I applied my solution.

I uninstalled macports and installed homebrew instead. Then I installed ImageMagick with homebrew and it worked just fine.
I needed to use the command: brew install imagemagick --build-from-source. The regular command gave me a different error

Related

I am not able to install Miniconda on MacOS X with Homebrew and .zsh

Please help, I tried to install Miniconda on Mac OS X Mojave with:
brew cask install miniconda
then I added export path to .zshrc file (Oh my Zsh):
export PATH="$PATH:$HOME/miniconda3/bin"
But it is not being recognized:
zsh: command not found: conda
I cant find what I am doing wrong
I finally had to do a workaround by downloading it directly:
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.sh
but I still don't understand why Homebrew is not working
After brew cask install miniconda, it was installed to /opt/miniconda3
After installing miniconda using homebrew, you will need to run:
/opt/miniconda3/condabin/conda init zsh
For more info see https://discourse.brew.sh/t/why-does-brew-cask-install-miniconda-to-opt-instead-of-usr-local-caskroom/7926

Homebrew's formula is not recognized

I just installed Homebrew in macOS Mojave. When trying:
$ brew install --fresh imagemagick --with-perl
there appears an output explanatory text about the usage of brew formulas, finishing by:
Error: invalid option: --fresh
Similarly, $ brew install imagemagick --with-perl gives out the forementioned text finishing by: Error: invalid option: --with-perl
(On the other hand, $ brew install imagemagick works, but there fails the perl interface, so that I wished to install it with the perl option as above).
There is no option --fresh to the brew command. If you want to reinstall a package, you do:
brew uninstall PACKAGE
brew install PACKAGE
All packages in homebrew-core no longer have any options - it was too onerous on the maintainers. Now all packages contain a core, broad set of options and that is what you get.
If you want to see how your ImageMagick is configured, use:
magick identify -list configure

error while loading shared libraries: libMagickCore-7.Q16HDRI.so.6

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

How to Install wkhtmltopdf?

Now i am working on rails 3.0.0.i am using Ubuntu 11.10 ,64 bit os.i want to install wkhtmltopdf.please tell me the static version of wkhtmltopdf.
Installing wkhtmltopdf
on Ubuntu Linux machine
First check os is 32 bit or 64 bit by using following command
Try uname -m. It seems like the uname -m actually gives x86_64 when it is an kernel 64 bits
Run following command
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev
Then run following command
sudo apt-get install wkhtmltopdf
Based on OS download wkhtmltopdf package from following site
http://code.google.com/p/wkhtmltopdf/downloads/list
OR
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
(wkhtmltopdf-0.9.9-static-i386.tar.bz2 is a stable release for wkhtmltopdf )
Then extract using command
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
Then move extracted DIR to usr/local/bin folder
sudo mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
Check wkhtmltopdf is install or not using following command
which wkhtmltopdf
wkhtmltopdf –help
Installing wkhtmltopdf on MacOs
brew install Caskroom/cask/wkhtmltopdf
Another way to use official binaries within Rails is adding the following line to your Gemfile:
gem 'wkhtmltopdf-installer'
This way the official binaries from http://wkhtmltopdf.org will be downloaded and added to your bundle during bundle install phase.
I encountered this problem this morning.
Before you do anything, please check out: https://github.com/pdfkit/pdfkit/wiki/Installing-WKHTMLTOPDF
Download a binary edition of wkhtmltopdf at http://code.google.com/p/wkhtmltopdf/downloads/list
Decompress the package.
Copy the file like wkhtmltopdf-i386 to /usr/local/bin/ & /opt/ (also you could make soft link).
That's done.
Good luck.

RMagick complains it was configured with a different version of ImageMagick

I am getting following error while running local script/server of my Rails project:
This installation of RMagick was configured with ImageMagick 6.6.1 but ImageMagick 6.4.5 is in use. (RuntimeError)
Running identify --version shows the following:
Version: ImageMagick 6.6.1-10 2010-05-21 Q8 http://www.imagemagick.org
So, my question is how and where should I make changes to work it fine; I have already reinstalled ImageMagick but that didn't work.
the same thing happened to me but the solution was a bit simpler than uninstalling imageMagick. It sounds like Rmagick's config file isn't updated to use your updated imagemagick so try
sudo gem uninstall rmagick
sudo gem install rmagick
restart your server.
I took a closer look and noticed you had Rmagick configured for a newer imageMagick but using an older imageMagick. So I would assume that my solution would still work but you would not be using the newer ImageMagick.
If using bundler:
bundle exec gem uninstall rmagick
bundle install (will reinstall rmagick as part of the bundle)
I would remove any previous installation and start again by following this page.
First of all open a shell and launch:
identify -version
which will give you the IM version installed on your system.
Depending on how You installed IM, find the way to remove It completely from the system. For instance if you used apt-get, try:
sudo apt-get remove ImageMagick
If you installed IM from sources, go to where you have them stored (I mean the sources path/folder) and type:
make uninstall
You can then reinstall ImageMagick, compiling it from the sources:
cd
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar zxf ImageMagick.tar.gz
cd ImageMagick-*/
./configure --prefix=$HOME --without-perl
make
make install
Then you have to add $HOME/bin to the beginning of your $PATH
cd
echo "export PATH=$HOME/bin:\$PATH" >> .bash_profile
source .bash_profile
Now it's time to gem install RMagick:
export LD_LIBRARY_PATH=$HOME/lib
gem install rmagick
RMAGICK_BYPASS_VERSION_TEST = true
Thats a global flag set before requiring rmagick.
from
https://bugs.launchpad.net/ubuntu/+source/librmagick-ruby/+bug/565461/comments/2
Worked and tested ok for me.
I made it work by uninstalling and then deleting the file listed in the error message (before reinstalling). It seems that uninstalling doesn't always clean up some of the old ".so" files.
I had the same issue, and eventually concluded that my installation of libmagick9-dev
(sudo apt-get install libmagick9-dev ruby1.8-dev) was installing ImageMagick APIs for the lower version. My solution was to uninstall the later versions and go with the Ubuntu packaged versions of ImageMagick and the other libraries.
I bumped into this on a Rails app. I tried Scott Montgomerie's answer, but I couldn't get bundle exec gem to work (not sure why, no time to find out).
What worked for me was a simple bundle update rmagick.
bundle update rmagick worked for me

Resources