-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac OS Issue #25
Comments
Hi, Apologies for the late response. I've tested the import on OS X 10.11.5 using python 3.5.1 (pyminc has been made Python3 compatible) using the minc-toolkit packages from here: http://bic-mni.github.io and am not seeing the same issues. The LD_LIBRARY_PATH for the above package is: /opt/minc-itk4/lib So exporting the LD_LIBRARY_PATH as follows: export LD_LIBRARY_PATH=/opt/minc-itk4/lib:$LD_LIBRARY_PATH should do the trick. Can I ask how you've installed the MINC libraries? |
My impression was that this wouldn't work anymore on macs ... @cfhammill ? |
I worked when I just tried it... :-) Perhaps because it's a slightly outdated version of the Mac OS? |
Did the issue happen before you set the LD_LIBRARY_PATH Matthijs? LD_LIBRARY_PATH shouldn't |
Before setting the LD_LIBRARY_PATH I got the error:
Afterwards I had no errors at all loading pyminc.volumes.factory |
I think I've made some progress. I can now run "from pyminc.volumes.factory import *"; however, this only works from within python. If I generate a python script, which works on linux without any issues, then run it on my local machine -- using minctools installed as described above. I've also set the LD_LIBRARY_PATH in bash. File "./create_noise.py", line 7, in I am running on 10.12, which may be the issue. |
What did you set your LD_LIBRARY_PATH to? And what is the full name of the MINC library you have installed on the Mac? |
echo $LD_LIBRARY_PATH returns: /opt/minc-itk4/lib:
In that directory, there are 4 libminc files:
/opt/minc-itk4/lib/libminc2.5.0.1.dylib
/opt/minc-itk4/lib/libminc_io.5.0.1.dylib
/opt/minc-itk4/lib/libminc2.dylib /opt/minc-itk4/lib/libminc_io.dylib
iPython works fine.
pyminc.__path__ returns ['/usr/local/lib/python2.7/site-packages/pyminc']
================
In Python, I get errors:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/pyminc/volumes/factory.py",
line 3, in <module>
from .volumes import mincException,mincVolume
File "/usr/local/lib/python2.7/site-packages/pyminc/volumes/volumes.py",
line 1, in <module>
from .libpyminc2 import *
File
"/usr/local/lib/python2.7/site-packages/pyminc/volumes/libpyminc2.py", line
4, in <module>
from ctypes.util import find_library
File
"/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/util.py",
line 2, in <module>
import subprocess
File
"/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
line 75, in <module>
import pickle
File
"/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py",
line 1272, in <module>
import binascii as _binascii
ImportError:
dlopen(/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/binascii.so,
2): Library not loaded: libz.1.dylib
Referenced from:
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/binascii.so
Reason: image not found
===================================
If I call a python script, I also get errors:
Something went wrong loading shared libraries ...Traceback (most recent
call last):
File "./stc.py", line 7, in <module>
from pyminc.volumes.factory import *
File "/usr/local/lib/python2.7/site-packages/pyminc/volumes/factory.py",
line 3, in <module>
from .volumes import mincException,mincVolume
File "/usr/local/lib/python2.7/site-packages/pyminc/volumes/volumes.py",
line 1, in <module>
from .libpyminc2 import *
File
"/usr/local/lib/python2.7/site-packages/pyminc/volumes/libpyminc2.py", line
18, in <module>
libminc = cdll.LoadLibrary("libminc2.so")
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py",
line 443, in LoadLibrary
return self._dlltype(name)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py",
line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libminc2.so, 6): image not found
Best Regards,
Donald McLaren, PhD
…On Fri, Feb 10, 2017 at 3:29 PM, Matthijs van Eede ***@***.*** > wrote:
What did you set your LD_LIBRARY_PATH to? And what is the full name of the
MINC library you have installed on the Mac?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOJCMuJ5BTCKKU6h8MV1RC-z4mCtZLNfks5rbMiwgaJpZM4LQLt5>
.
|
I'm getting the same kinds of errors when I'm using python 2.7. However, using python 3.5.1 resolves them. Can you give that a try? |
Using: from pyminc.volumes.factory import *
Leads to the following issue:
/Users/mclaren/ in ()
----> 1 from pyminc.volumes.factory import *
/usr/local/lib/python2.7/site-packages/pyminc/volumes/factory.py in ()
1 """factories for creating mincVolumes"""
2
----> 3 from .volumes import mincException,mincVolume
4
5 def volumeFromFile(filename, dtype="float", readonly=True, labels=False):
/usr/local/lib/python2.7/site-packages/pyminc/volumes/volumes.py in ()
----> 1 from .libpyminc2 import *
2 from .hyperslab import HyperSlab
3 import operator
4 import os
5 import sys
/usr/local/lib/python2.7/site-packages/pyminc/volumes/libpyminc2.py in ()
107 # argument declarations - not really necessary but does make
--> 109 libminc.miopen_volume.argtypes = [c_stringy, c_int, POINTER(mihandle)]
110 libminc.miget_real_value.argtypes = [mihandle, location, c_int, POINTER(voxel)]
111 libminc.miget_volume_dimensions.argtypes = [mihandle, c_int, c_int, c_int,
/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/ctypes/init.pyc in getattr(self, name)
376 if name.startswith('') and name.endswith(''):
377 raise AttributeError(name)
--> 378 func = self.getitem(name)
379 setattr(self, name, func)
380 return func
/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/ctypes/init.pyc in getitem(self, name_or_ordinal)
381
382 def getitem(self, name_or_ordinal):
--> 383 func = self._FuncPtr((name_or_ordinal, self))
384 if not isinstance(name_or_ordinal, (int, long)):
385 func.name = name_or_ordinal
AttributeError: dlsym(0x102fdc290, miopen_volume): symbol not found
The text was updated successfully, but these errors were encountered: