Closed drtrigon closed 8 years ago
So, the people over at wand
give the error message related to the system only. i.e. if youre on Ubuntu/Debian they don't show yum
. The relevant code is in their repo.
I like that! We need similar messages in our part of the code.
As mentioned in https://phabricator.wikimedia.org/T138121#2407656, IMHO there is a need for a final solution but I do not think this should be part of the current project. So I would say 'externals' has to come back in some way combined with the other approaches out there, but that something for the future... ;)
https://gist.github.com/drtrigon/7231d760b26d8ea1370b35929da05f58
I've made a modification to the codebase now, which would give error messages like this if installation fails:
(py27) [ajk@localhost file-metadata]$ pip install -e .
Obtaining file:///home/ajk/Documents/wiki/file-metadata
Complete output from command python setup.py egg_info:
Check and install dependencies required for setup:
distro - Will be installed with pip.
setuptools - Will be installed with pip.
Check dependencies required for using file-metadata:
libmagic - Found "file" utility at /usr/bin/file.
python-magic - Will be installed with pip.
six - Will be installed with pip.
exiftool - Needs to be installed manually.
appdirs - Will be installed with pip.
pathlib - Backported pathlib2 will be installed with pip.
liblzma - Found with pkg-config.
lzma - Will install backports.lzma with pip.
pillow - Will be installed with pip.
setuptools - numpy - Will be installed with pip.
dlib - Will be installed with pip.
scikit-image - Will be installed with pip.
magickwand - Needs to be installed manually.
wand - Will be installed with pip.
libzbar - Found libzbar.so.0.
zbar - Will be installed with pip.
java - Found at /usr/bin/java.
pycolorname - Will be installed with pip.
ffprobe - Needs to be installed manually.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ajk/Documents/wiki/file-metadata/setup.py", line 100, in <module>
install_required = get_install_requires(install_deps)
File "/home/ajk/Documents/wiki/file-metadata/setup.py", line 70, in get_install_requires
for dep in check_deps(deplist):
File "/home/ajk/Documents/wiki/file-metadata/setup.py", line 64, in check_deps
raise DistutilsSetupError(msg)
distutils.errors.DistutilsSetupError: Some dependencies could not be installed automatically: exiftool, boost-python, magickwand, ffprobe
* Try installing exiftool with `dnf install perl-Image-ExifTool`
* Try installing boost-python with `dnf install boost-python`
* Try installing magickwand with `dnf install ImageMagick-devel`
* Try installing ffprobe with `dnf install ffmpeg`. Note: This requires the RPMFusion repo to be enabled.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/ajk/Documents/wiki/file-metadata/
That look very nice!! I like it!
Next step ask the user whether it should be done for convenience and then ask for permission to execute the command. That could be done using e.g. invoke.
Dr. Trigon
Running the test bot script gave me a very nice error message, see below - well done!
However I would like to mention to add also info for fedora distributions (yum) and may be others (osx, later win) so we should have this in manner easily adoptable - e.g. a dict at the beginning of a file or even a own file (like i18n e.g.).