Installing File::MMagic using CPAN but can't be found in #INC - macos

I've tried installing File::MMagic in CPAN using
install File::MMagic
in CPAN.
When I try to call my script and associated variable (which uses File::MMagic) it fails telling me that File/MMagic.pm can't be found in #INC. Unsure how to proceed, all suggestions welcome! I'm on Mac OS Sierra

So I solved this. The answer could be found in the error message. When it installs File::MMagic the directory structure it creates doesn't include a File directory. The script is trying to call File/MMagic.pm. By creating a new directory and calling it File and putting MMagic.pm in there it ran successfully.

Related

How to specify external library file locations when installing CPAN modules

I'm trying to get Perl's Finance::Quote module working after MacOS upgrade to 11.4. One of the dependencies is B::Keywords. B::Keywords installation fails a test with this error:
> sudo cpan B::Keywords
[...]
Can't open /System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h: No such file or directory at t/11keywords.t line 25
Digging around, I see that keywords.h exists on my system in this location:
/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/keywords.h
Is there a way to tell cpan (or cpanm, or some other installation tool) where to look for these headers? Or, any other approach to get this working would be welcome.
It seems like they removed the keywords.h from the CORE directory (relative to the path given from $Config{archlibexp}) for the system perl on macOS 10.14, see this bug report.
The reason you are not able to install B::Keywords is due to a failed test 11keywords.t see line 24. Some possible solutions:
Install the module without running the tests (sudo cpan -T B::Keywords)
Submit an issue at the GitHub issue tracker so the author of the module can fix the problem.
Install the module with perlbrew instead of using the system perl (I tested this and it worked fine here).

Ubuntu libexiv2.so.26 missing error message

I am working with the exiv2 library. I currently faced an issue, and i can't find my way out of it. Here is the issue.
I installed the exiv2 library. When I try to run it, the following error is given.
exiv2: error while loading the shared libraries: libexiv2.so.26: cannot open shared object file: No such file or directory
But, when i open the /usr/local/lib folder, it exists there. Again when I try to locate the library using the ldd command, the command cannot locate it!
Can anyone help me to find what is going on there? Thanks in advance!
If not how to uninstall the whole library and reinstall it?
I had a similar problem when using the sources for installing.
You can remove the built files with sudo make uninstall from inside the sources folder of exiv2.
The solution to my problem was to simply use the package from the Ubuntu repository: sudo apt install exiv2 libexiv2-dev.
Hopefully this will help you too.

Has anyone managed to add custom icons into Ionic in Windows?

I refer the instructions here
What I did (on Windows):
Install fontforge through web instead of 'brew'
Install SASS through Ruby GEM
Place my-icon.svg inside src/ (of the ionicons-master)
Run the python ./builder/generate.py
I think I am very closed. Until i saw this error message:
windowsError: The system cannot find the file specified
And I think I get even closer when I saw the last post of this link
But, I don't get what it means. I downloaded the .exe but it doesn't work.
Is it the python build only meant for MAC? Has anyone managed to make this work in Windows?

Jython 2.5 and virtualenv on windows

I have installed Jython 2.5 on Windows, then setuptools and finally virtualenv (1.8.4) using easy_install. Now I am trying to create a new virtual environment using the following command line :
jython \Lib\site-packages\virtualenv-1.8.4-py2.5.egg\virtualenv.py jython_env
But the creation of the new virtual environment fails with the following error:
os.symlink(py_executable_base, full_pth)
AttributeError: 'module' object has no attribute 'symlink'
I guess this is because Windows does not handle symlinks but does anyone already meet this issue, is there any workaround ?
Thanks
A little bit late, but for the benefit of others who may read this page...
I recently encountered the same issue with jython2.7.0 and managed to get around this by hacking jython's Lib/os.py (mine was under C:\jython2.7.0) to add at the bottom:
def symlink(target, file):
''' Just copy files in Windows,
maybe you could use mklink system calls instead '''
from shutil import copy
copy(file, target)
Don't forget to remove the compiled bytecode version of the os module otherwise the changes won't be loaded.
Then try running virtualenv -p /path/to/jython.exe jython-env-name.
Note that you should either have python2*.dll from your jython bin/ directory in your system PATH , have the dll registered or else copy the dll into your new virtualenv's bin directory.

Xlib.h not found when building graphviz on Mac OS X 10.8 (Mountain Lion)

When using homebrew to install graphviz, the script gets to the point of "Making install in tkstubs" and then throws the following fatal error:
In file included from tkStubLib.c:15:
/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
I have installed XQuartz as X11 has been dropped in Mountain Lion, but I'm unsure if it is installed correctly. The location of Xlib.h is:
/opt/X11/include/X11/Xlib.h
There are also two symlinks to /opt/X11, they are:
/usr/X11
/usr/X11R6
Does this look like the correct setup to you? I've never dealt with X11 or XQuartz until yesterday.
Cheers.
After installing XQuartz you may add a symlink to your X11 installation folder by just entering
ln -s /opt/X11/include/X11 /usr/local/include/X11
in terminal. That will fix the problem as well without changing any ruby script.
You need to tell the tkstubs build (and possibly other bits in the package as well) to look for headers in /opt/X11/include; this is not on the standard include path.
Usually this is achieved by passing -I/opt/X11/include as an additional compiler flag, the method to do so is however dependent on the build system.
For reasonably modern configure scripts, the best approach is to pass it in the environment variable CPPFLAGS; if the package uses another build system or this doesn't work for another reason, then you need to look at the Makefile in the build directory.
You can enter in your shell before the compile/link (or brew) command:
export CPPFLAGS=-I/opt/X11/include
The export line will tell the compile/linker to look in /opt/X11/include for the X11 include files
Had the same issue and running this command on terminal
xcode-select --install
worked for me. Run this command after installing xQuartz.
If you need this to work in your CMake builds:
if(APPLE)
include_directories(AFTER "/opt/X11/include")
endif()
That worked well for me.
I got it to install by copying the x11 header file directory to the /opt/local/include directory. Probably not the best way to work around it but quick and easy.
I found this thread while trying to compile ffmpeg from source on OS X. I needed --enable-x11grab and the homebrew build does not support this option.
I had XQuartz installed already but I kept getting errors from ./configure: ERROR: Xlib not found. I thought the answers here would solve my problem, but they did not!
So, if anyone is ever in the same boat, my solution was this:
I opened up the generated config.log and found lots of errors referring to various includes and header files, including X11/Xlib.h - this is misleading. At the very bottom of the logfile was the key, pkg-config was complaining about looking for xbc.pc, and requested that it be put on the path. However, the error message that is displayed on the terminal says nothing about pkg-config or xbc!
The solution is to add to your PKG_CONFIG_PATH environment variable. Mine was nonexistent, so I just did export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ (the folder where I found xbc.pc).
I reran configure and everything worked like a charm!
TL;DR: check config.log - don't trust the terminal output!
Since the make file is looking for X11/xlib.h i.e., it is looking for X11 folder in the current directory, one way to solve this problem is to simply copy the /opt/X11/include/X11 directory to the directory that contains make file.

Resources