jpegio icon indicating copy to clipboard operation
jpegio copied to clipboard

macOS mojave 10.14.5 import error

Open mohaoran93 opened this issue 4 years ago • 3 comments

When I import the package, I encountered one error like this from .componentinfo import ComponentInfo ModuleNotFoundError: No module named 'jpegio.componentinfo' All log from installation to import are following,

(py3image) Mo-Haorans-MBP:jpegio mo$ python setup.py install
[LIBJPEG] libjpeg-turbo is used for the functionality of libjpeg.
DIR_LIBJPEG_HEADER: /Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio/libjpeg-turbo/mac_x64/include
DIR_LIBJPEG_SOURCE: jpegio/libjpeg-turbo/mac_x64/src
Compiling jpegio/componentinfo.pyx because it changed.
Compiling jpegio/decompressedjpeg.pyx because it changed.
[1/2] Cythonizing jpegio/componentinfo.pyx
[2/2] Cythonizing jpegio/decompressedjpeg.pyx
running install
running bdist_egg
running egg_info
creating jpegio.egg-info
writing jpegio.egg-info/PKG-INFO
writing dependency_links to jpegio.egg-info/dependency_links.txt
writing top-level names to jpegio.egg-info/top_level.txt
writing manifest file 'jpegio.egg-info/SOURCES.txt'
reading manifest file 'jpegio.egg-info/SOURCES.txt'
writing manifest file 'jpegio.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.9-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/flags.py -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/io.py -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/clibjpeg.pxd -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/componentinfo.pxd -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/decompressedjpeg.pxd -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/jstruct.pxd -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/componentinfo.pyx -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/decompressedjpeg.pyx -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/mat2D.h -> build/lib.macosx-10.9-x86_64-3.6/jpegio
copying jpegio/jstruct.h -> build/lib.macosx-10.9-x86_64-3.6/jpegio
running build_ext
building 'jpegio.componentinfo' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/jpegio
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mo/anaconda3/envs/py3image/include -arch x86_64 -I/Users/mo/anaconda3/envs/py3image/include -arch x86_64 -I. -I/Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/numpy/core/include -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio/libjpeg-turbo/mac_x64/include -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio -I/Users/mo/anaconda3/envs/py3image/include/python3.6m -c jpegio/componentinfo.cpp -o build/temp.macosx-10.9-x86_64-3.6/jpegio/componentinfo.o -w -fPIC -march=native -std=c++11 -mmacosx-version-min=10.9 -m64
g++ -bundle -undefined dynamic_lookup -L/Users/mo/anaconda3/envs/py3image/lib -arch x86_64 -L/Users/mo/anaconda3/envs/py3image/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.9-x86_64-3.6/jpegio/componentinfo.o -o build/lib.macosx-10.9-x86_64-3.6/jpegio/componentinfo.cpython-36m-darwin.so -stdlib=libc++ -mmacosx-version-min=10.9
building 'jpegio.decompressedjpeg' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mo/anaconda3/envs/py3image/include -arch x86_64 -I/Users/mo/anaconda3/envs/py3image/include -arch x86_64 -I./jpegio -I. -I/Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/numpy/core/include -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio/libjpeg-turbo/mac_x64/include -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio -I/Users/mo/anaconda3/envs/py3image/include/python3.6m -c jpegio/decompressedjpeg.cpp -o build/temp.macosx-10.9-x86_64-3.6/jpegio/decompressedjpeg.o -w -fPIC -march=native -std=c++11 -mmacosx-version-min=10.9 -m64
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mo/anaconda3/envs/py3image/include -arch x86_64 -I/Users/mo/anaconda3/envs/py3image/include -arch x86_64 -I./jpegio -I. -I/Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/numpy/core/include -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio/libjpeg-turbo/mac_x64/include -I/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio -I/Users/mo/anaconda3/envs/py3image/include/python3.6m -c jpegio/jstruct.cpp -o build/temp.macosx-10.9-x86_64-3.6/jpegio/jstruct.o -w -fPIC -march=native -std=c++11 -mmacosx-version-min=10.9 -m64
g++ -bundle -undefined dynamic_lookup -L/Users/mo/anaconda3/envs/py3image/lib -arch x86_64 -L/Users/mo/anaconda3/envs/py3image/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.9-x86_64-3.6/jpegio/decompressedjpeg.o build/temp.macosx-10.9-x86_64-3.6/jpegio/jstruct.o -L/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio/libjpeg-turbo/mac_x64/lib -ljpeg -o build/lib.macosx-10.9-x86_64-3.6/jpegio/decompressedjpeg.cpython-36m-darwin.so -stdlib=libc++ -mmacosx-version-min=10.9
creating build/bdist.macosx-10.9-x86_64
creating build/bdist.macosx-10.9-x86_64/egg
creating build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/componentinfo.pyx -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/decompressedjpeg.pyx -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/componentinfo.cpython-36m-darwin.so -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/flags.py -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/io.py -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/__init__.py -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/clibjpeg.pxd -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/decompressedjpeg.cpython-36m-darwin.so -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/componentinfo.pxd -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/decompressedjpeg.pxd -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/mat2D.h -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/jstruct.pxd -> build/bdist.macosx-10.9-x86_64/egg/jpegio
copying build/lib.macosx-10.9-x86_64-3.6/jpegio/jstruct.h -> build/bdist.macosx-10.9-x86_64/egg/jpegio
byte-compiling build/bdist.macosx-10.9-x86_64/egg/jpegio/flags.py to flags.cpython-36.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/jpegio/io.py to io.cpython-36.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/jpegio/__init__.py to __init__.cpython-36.pyc
creating stub loader for jpegio/componentinfo.cpython-36m-darwin.so
creating stub loader for jpegio/decompressedjpeg.cpython-36m-darwin.so
byte-compiling build/bdist.macosx-10.9-x86_64/egg/jpegio/componentinfo.py to componentinfo.cpython-36.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/jpegio/decompressedjpeg.py to decompressedjpeg.cpython-36.pyc
creating build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying jpegio.egg-info/PKG-INFO -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying jpegio.egg-info/SOURCES.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying jpegio.egg-info/dependency_links.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying jpegio.egg-info/not-zip-safe -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying jpegio.egg-info/top_level.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
writing build/bdist.macosx-10.9-x86_64/egg/EGG-INFO/native_libs.txt
creating 'dist/jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg' and adding 'build/bdist.macosx-10.9-x86_64/egg' to it
removing 'build/bdist.macosx-10.9-x86_64/egg' (and everything under it)
Processing jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg
removing '/Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg' (and everything under it)
creating /Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg
Extracting jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg to /Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages
jpegio 0.2.1 is already the active version in easy-install.pth

Installed /Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg
Processing dependencies for jpegio==0.2.1
Finished processing dependencies for jpegio==0.2.1
(py3image) Mo-Haorans-MBP:jpegio mo$ python
Python 3.6.10 |Anaconda, Inc.| (default, May  7 2020, 23:06:31) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import jpegio as jio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mo/Documents/projects_none_git/alaska2/jpeg_explanations/jpegio/jpegio/__init__.py", line 6, in <module>
    from .componentinfo import ComponentInfo
ModuleNotFoundError: No module named 'jpegio.componentinfo'

mohaoran93 avatar May 27 '20 18:05 mohaoran93

You should import the package outside the jpegio directory (e.g., jpegio mo). Have you tried?

dwgoon avatar May 27 '20 23:05 dwgoon

When I work outside the jpegio dir, I got different error

>>> import jpegio as jio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg/jpegio/__init__.py", line 7, in <module>
    from .decompressedjpeg import DecompressedJpeg
ImportError: dlopen(/Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg/jpegio/decompressedjpeg.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libjpeg.62.dylib
  Referenced from: /Users/mo/anaconda3/envs/py3image/lib/python3.6/site-packages/jpegio-0.2.1-py3.6-macosx-10.9-x86_64.egg/jpegio/decompressedjpeg.cpython-36m-darwin.so
  Reason: image not found

mohaoran93 avatar May 29 '20 15:05 mohaoran93

Most likely this will be solved in https://github.com/dwgoon/jpegio/pull/27 could you check it now please? @mohaoran93

detrin avatar Aug 14 '23 10:08 detrin