Opened 5 years ago

Closed 5 years ago

#48379 closed defect (fixed)

caffe import error Reason: image not found

Reported by: hansimglueck@… Owned by: humem (humem)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc:
Port: caffe

Description (last modified by ryandesign (Ryan Schmidt))

Import error for caffe on osx 10.10 and Pyhton 2.7

adding

export PYTHONPATH=/opt/local/libexec/caffe/python:$PYTHONPATH before macports import

resolves the problem!!

Folder /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/caffe exists, but is certainly not imported correctly...

Thanks

python

>>>import caffe
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-1cca3aa1f8c5> in <module>()
----> 1 import caffe

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/caffe/__init__.py in <module>()
----> 1 from .pycaffe import Net, SGDSolver
      2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
      3 from .proto.caffe_pb2 import TRAIN, TEST
      4 from .classifier import Classifier
      5 from .detector import Detector

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/caffe/pycaffe.py in <module>()
     11 import numpy as np
     12
---> 13 from ._caffe import Net, SGDSolver
     14 import caffe.io
     15

ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/caffe/_caffe.so, 2): Library not loaded: @rpath/libcaffe.so
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/caffe/_caffe.so
  Reason: image not found

Change History (5)

comment:1 Changed 5 years ago by hansimglueck@…

Cc: hansimglueck@… added

Cc Me!

comment:2 Changed 5 years ago by hansimglueck@…

Cc: hansimglueck@… removed

Cc Me!

comment:3 Changed 5 years ago by ryandesign (Ryan Schmidt)

Owner: changed from macports-tickets@… to hum@…

comment:4 Changed 5 years ago by ryandesign (Ryan Schmidt)

Description: modified (diff)

comment:5 Changed 5 years ago by humem (humem)

Resolution: fixed
Status: newclosed

Thank you very much for your report. I modified the Portfile to set the shared library name and PYTHONPATH is not needed. Committed in r138750.

Note: See TracTickets for help on using tickets.