Skip to content
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

pip install not working on MAC OS X (Sierra) #26

Closed
pieterw opened this issue Oct 18, 2016 · 4 comments
Closed

pip install not working on MAC OS X (Sierra) #26

pieterw opened this issue Oct 18, 2016 · 4 comments
Labels

Comments

@pieterw
Copy link

pieterw commented Oct 18, 2016

I get the following

(apicbase)MacBook-Pro-5:libgphoto2-2.5.10 pieter$ pip install -v gphoto2
Downloading/unpacking gphoto2
Using version 1.4.1 (newest of versions: 1.4.1, 1.4.1, 1.4.0, 1.4.0, 1.3.4, 1.3.4, 1.3.3, 1.3.3, 1.3.2, 1.3.2, 1.3.1, 1.3.1, 1.2.2, 1.2.2, 1.2.1, 1.2.1, 1.2.0, 1.2.0, 1.1.0, 1.1.0, 1.0.0, 1.0.0, 0.11.2, 0.11.2, 0.11.1, 0.11.1, 0.11.0, 0.11.0, 0.10.2, 0.10.2, 0.10.1, 0.10.1, 0.10.0, 0.10.0, 0.9.1, 0.9.1, 0.9.0, 0.9.0, 0.8.0, 0.8.0, 0.7.1, 0.7.1, 0.7.0, 0.7.0, 0.6.0, 0.6.0, 0.5.2, 0.5.2, 0.5.1, 0.5.1, 0.5.0, 0.5.0, 0.4.0, 0.4.0, 0.3.3, 0.3.3, 0.3.2, 0.3.2)
Downloading gphoto2-1.4.1.zip (3.7MB):
Downloading from URL https://pypi.python.org/packages/3e/ae/981c4720259162a78fc6b309c3a591043b78a8dd35f3dd416025f62f69f4/gphoto2-1.4.1.zip#md5=afb3f20c657abcf8eb3193839ba65691 (from https://pypi.python.org/simple/gphoto2/)
...Downloading gphoto2-1.4.1.zip (3.7MB): 3.7MB downloaded
Running setup.py (path:/Users/pieter/.virtualenvs/apicbase/build/gphoto2/setup.py) egg_info for package gphoto2
running egg_info
creating pip-egg-info/gphoto2.egg-info
writing dependency_links to pip-egg-info/gphoto2.egg-info/dependency_links.txt
writing pip-egg-info/gphoto2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/gphoto2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/gphoto2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found

reading manifest file 'pip-egg-info/gphoto2.egg-info/SOURCES.txt'
writing manifest file 'pip-egg-info/gphoto2.egg-info/SOURCES.txt'

Installing collected packages: gphoto2
Running setup.py install for gphoto2
running install
running build
running build_py
creating build
creating build/lib.macosx-10.12-intel-2.7
creating build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/init.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/abilities_list.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/camera.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/context.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/file.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/filesys.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/list.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/port.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/port_info_list.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/port_log.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/result.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/version.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
copying src/swig-bi-gp2.5-py2/widget.py -> build/lib.macosx-10.12-intel-2.7/gphoto2
running build_ext
building '_abilities_list' extension
creating build/temp.macosx-10.12-intel-2.7
creating build/temp.macosx-10.12-intel-2.7/src
creating build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/swig-bi-gp2.5-py2/abilities_list_wrap.c -o build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/abilities_list_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/abilities_list_wrap.o -L/opt/local/lib -lgphoto2 -lm -lgphoto2_port -lm -o build/lib.macosx-10.12-intel-2.7/gphoto2/_abilities_list.so
ld: warning: ld: warning: ignoring file /opt/local/lib/libgphoto2.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2.dylibignoring file /opt/local/lib/libgphoto2_port.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2_port.dylib

building '_camera' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/swig-bi-gp2.5-py2/camera_wrap.c -o build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/camera_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/camera_wrap.o -L/opt/local/lib -lgphoto2 -lm -lgphoto2_port -lm -o build/lib.macosx-10.12-intel-2.7/gphoto2/_camera.so
ld: warning: ld: warning: ignoring file /opt/local/lib/libgphoto2.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2.dylibignoring file /opt/local/lib/libgphoto2_port.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2_port.dylib

building '_context' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/swig-bi-gp2.5-py2/context_wrap.c -o build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/context_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/context_wrap.o -L/opt/local/lib -lgphoto2 -lm -lgphoto2_port -lm -o build/lib.macosx-10.12-intel-2.7/gphoto2/_context.so
ld: warning: ld: warning: ignoring file /opt/local/lib/libgphoto2.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2.dylibignoring file /opt/local/lib/libgphoto2_port.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2_port.dylib

building '_file' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/swig-bi-gp2.5-py2/file_wrap.c -o build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/file_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25
src/swig-bi-gp2.5-py2/file_wrap.c:4310:68: error: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2)));
                                                    ~~~~~~~~~~~~~  ^~~~~
src/swig-bi-gp2.5-py2/file_wrap.c:4978:68: error: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]
    resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2)));
                                                    ~~~~~~~~~~~~~  ^~~~~
2 errors generated.
error: command 'cc' failed with exit status 1
Complete output from command /Users/pieter/.virtualenvs/apicbase/bin/python -c "import setuptools, tokenize;__file__='/Users/pieter/.virtualenvs/apicbase/build/gphoto2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/44/m1ddz6bn01167z5g9j2f6yr80000gn/T/pip-hwTf0l-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/pieter/.virtualenvs/apicbase/include/site/python2.7:
running install

running build

running build_py

creating build

creating build/lib.macosx-10.12-intel-2.7

creating build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/init.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/abilities_list.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/camera.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/context.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/file.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/filesys.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/list.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/port.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/port_info_list.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/port_log.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/result.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/version.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

copying src/swig-bi-gp2.5-py2/widget.py -> build/lib.macosx-10.12-intel-2.7/gphoto2

running build_ext

building '_abilities_list' extension

creating build/temp.macosx-10.12-intel-2.7

creating build/temp.macosx-10.12-intel-2.7/src

creating build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2

cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/swig-bi-gp2.5-py2/abilities_list_wrap.c -o build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/abilities_list_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25

cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/abilities_list_wrap.o -L/opt/local/lib -lgphoto2 -lm -lgphoto2_port -lm -o build/lib.macosx-10.12-intel-2.7/gphoto2/_abilities_list.so

ld: warning: ld: warning: ignoring file /opt/local/lib/libgphoto2.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2.dylibignoring file /opt/local/lib/libgphoto2_port.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2_port.dylib

building '_camera' extension

cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/swig-bi-gp2.5-py2/camera_wrap.c -o build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/camera_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25

cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/camera_wrap.o -L/opt/local/lib -lgphoto2 -lm -lgphoto2_port -lm -o build/lib.macosx-10.12-intel-2.7/gphoto2/_camera.so

ld: warning: ld: warning: ignoring file /opt/local/lib/libgphoto2.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2.dylibignoring file /opt/local/lib/libgphoto2_port.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2_port.dylib

building '_context' extension

cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/swig-bi-gp2.5-py2/context_wrap.c -o build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/context_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25

cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/context_wrap.o -L/opt/local/lib -lgphoto2 -lm -lgphoto2_port -lm -o build/lib.macosx-10.12-intel-2.7/gphoto2/_context.so

ld: warning: ld: warning: ignoring file /opt/local/lib/libgphoto2.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2.dylibignoring file /opt/local/lib/libgphoto2_port.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libgphoto2_port.dylib

building '_file' extension

cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/swig-bi-gp2.5-py2/file_wrap.c -o build/temp.macosx-10.12-intel-2.7/src/swig-bi-gp2.5-py2/file_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25

src/swig-bi-gp2.5-py2/file_wrap.c:4310:68: error: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]

resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2)));

                                                ~~~~~~~~~~~~~  ^~~~~

src/swig-bi-gp2.5-py2/file_wrap.c:4978:68: error: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32]

resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2)));

                                                ~~~~~~~~~~~~~  ^~~~~

2 errors generated.

error: command 'cc' failed with exit status 1


Cleaning up...
Removing temporary dir /Users/pieter/.virtualenvs/apicbase/build...
Command /Users/pieter/.virtualenvs/apicbase/bin/python -c "import setuptools, tokenize;file='/Users/pieter/.virtualenvs/apicbase/build/gphoto2/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/44/m1ddz6bn01167z5g9j2f6yr80000gn/T/pip-hwTf0l-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/pieter/.virtualenvs/apicbase/include/site/python2.7 failed with error code 1 in /Users/pieter/.virtualenvs/apicbase/build/gphoto2
Exception information:
Traceback (most recent call last):
File "/Users/pieter/.virtualenvs/apicbase/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Users/pieter/.virtualenvs/apicbase/lib/python2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Users/pieter/.virtualenvs/apicbase/lib/python2.7/site-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, _args, *_kwargs)
File "/Users/pieter/.virtualenvs/apicbase/lib/python2.7/site-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Users/pieter/.virtualenvs/apicbase/lib/python2.7/site-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /Users/pieter/.virtualenvs/apicbase/bin/python -c "import setuptools, tokenize;file='/Users/pieter/.virtualenvs/apicbase/build/gphoto2/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/44/m1ddz6bn01167z5g9j2f6yr80000gn/T/pip-hwTf0l-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/pieter/.virtualenvs/apicbase/include/site/python2.7 failed with error code 1 in /Users/pieter/.virtualenvs/apicbase/build/gphoto2

Storing debug log for failure in /Users/pieter/.pip/pip.log

In short it has to do with handling integers (probably a difference on mac).

I have libgphoto installed. Any help is welcome!

Kind regards,

Pieter

@jim-easterbrook
Copy link
Owner

jim-easterbrook commented Oct 18, 2016

I'm slightly concerned that the compilation includes both 32-bit and 64-bit flags -arch i386 -arch x86_64 but this is probably not the problem.

Since releasing v1.4.1 I've removed the -Werror flag because of problems like this. I don't have time to issue a new release this week, but if you can download and build/install the current development version from GitHub then it should work OK.

I shouldn't be casting time_t to an int though, so there's something to be investigated.

@pieterw
Copy link
Author

pieterw commented Oct 18, 2016

That solved the issue! Thanks for the quick response.

@jim-easterbrook
Copy link
Owner

Commit 3a36487 should fix the underlying problem. Although time_t does not seem to have a universal definition, so there may still be a problem on some platforms.

@jim-easterbrook
Copy link
Owner

I've just released version 1.5.0 which should install OK with pip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants