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

Failed installation on MacOS 10.14.5 #2

Open
ezadEzanee opened this issue May 30, 2019 · 4 comments
Open

Failed installation on MacOS 10.14.5 #2

ezadEzanee opened this issue May 30, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ezadEzanee
Copy link

Hi, the following is the error output when running pip3 install fastgrab

MacOS 10.14.5
Python 3.7.3
Numpy 1.16.4
XQuartz 2.7.11 (xorg-server 1.18.4)
gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin


Failed building wheel for fastgrab
Running setup.py clean for fastgrab
Failed to build fastgrab
Installing collected packages: fastgrab
Running setup.py install for fastgrab ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/hr/4vld7k61587b6vd95wrmknp80000gn/T/pip-install-ii2z67f6/fastgrab/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/hr/4vld7k61587b6vd95wrmknp80000gn/T/pip-record-c128id6t/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/fastgrab
copying fastgrab/metadata.py -> build/lib.macosx-10.14-x86_64-3.7/fastgrab
copying fastgrab/init.py -> build/lib.macosx-10.14-x86_64-3.7/fastgrab
copying fastgrab/screenshot.py -> build/lib.macosx-10.14-x86_64-3.7/fastgrab
running build_ext
building 'fastgrab._linux_x11' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/fastgrab
creating build/temp.macosx-10.14-x86_64-3.7/fastgrab/linux_x11
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c fastgrab/linux_x11/screenshot.c -o build/temp.macosx-10.14-x86_64-3.7/fastgrab/linux_x11/screenshot.o -fno-strict-aliasing -std=c11 -mtune=native
fastgrab/linux_x11/screenshot.c:16:15: warning: implicit declaration of function 'XOpenDisplay' is invalid in C99 [-Wimplicit-function-declaration]
display = XOpenDisplay(NULL);
^
fastgrab/linux_x11/screenshot.c:16:13: warning: incompatible integer to pointer conversion assigning to 'Display *' (aka 'struct _XDisplay *') from 'int' [-Wint-conversion]
display = XOpenDisplay(NULL);
^ ~~~~~~~~~~~~~~~~~~
fastgrab/linux_x11/screenshot.c:20:5: warning: implicit declaration of function 'XCloseDisplay' is invalid in C99 [-Wimplicit-function-declaration]
XCloseDisplay(display);
^
fastgrab/linux_x11/screenshot.c:32:15: warning: implicit declaration of function 'XOpenDisplay' is invalid in C99 [-Wimplicit-function-declaration]
display = XOpenDisplay(NULL);
^
fastgrab/linux_x11/screenshot.c:32:13: warning: incompatible integer to pointer conversion assigning to 'Display *' (aka 'struct _XDisplay *') from 'int' [-Wint-conversion]
display = XOpenDisplay(NULL);
^ ~~~~~~~~~~~~~~~~~~
fastgrab/linux_x11/screenshot.c:34:11: warning: implicit declaration of function 'XGetImage' is invalid in C99 [-Wimplicit-function-declaration]
img = XGetImage(display,
^
fastgrab/linux_x11/screenshot.c:34:9: warning: incompatible integer to pointer conversion assigning to 'XImage *' (aka 'struct _XImage *') from 'int' [-Wint-conversion]
img = XGetImage(display,
^ ~~~~~~~~~~~~~~~~~~
fastgrab/linux_x11/screenshot.c:53:5: warning: implicit declaration of function 'XCloseDisplay' is invalid in C99 [-Wimplicit-function-declaration]
XCloseDisplay(display);
^
fastgrab/linux_x11/screenshot.c:78:15: warning: implicit declaration of function 'XOpenDisplay' is invalid in C99 [-Wimplicit-function-declaration]
display = XOpenDisplay(NULL);
^
fastgrab/linux_x11/screenshot.c:78:13: warning: incompatible integer to pointer conversion assigning to 'Display *' (aka 'struct _XDisplay *') from 'int' [-Wint-conversion]
display = XOpenDisplay(NULL);
^ ~~~~~~~~~~~~~~~~~~
fastgrab/linux_x11/screenshot.c:79:11: warning: implicit declaration of function 'XGetImage' is invalid in C99 [-Wimplicit-function-declaration]
img = XGetImage(display,
^
fastgrab/linux_x11/screenshot.c:79:9: warning: incompatible integer to pointer conversion assigning to 'XImage *' (aka 'struct _XImage *') from 'int' [-Wint-conversion]
img = XGetImage(display,
^ ~~~~~~~~~~~~~~~~~~
fastgrab/linux_x11/screenshot.c:85:5: warning: implicit declaration of function 'XCloseDisplay' is invalid in C99 [-Wimplicit-function-declaration]
XCloseDisplay(display);
^
13 warnings generated.
clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk build/temp.macosx-10.14-x86_64-3.7/fastgrab/linux_x11/screenshot.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lX11 -lgomp -o build/lib.macosx-10.14-x86_64-3.7/fastgrab/_linux_x11.cpython-37m-darwin.so
ld: library not found for -lX11
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

----------------------------------------

Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/hr/4vld7k61587b6vd95wrmknp80000gn/T/pip-install-ii2z67f6/fastgrab/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/hr/4vld7k61587b6vd95wrmknp80000gn/T/pip-record-c128id6t/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/hr/4vld7k61587b6vd95wrmknp80000gn/T/pip-install-ii2z67f6/fastgrab/

@mherkazandjian mherkazandjian self-assigned this May 31, 2019
@mherkazandjian mherkazandjian added the bug Something isn't working label May 31, 2019
@mherkazandjian
Copy link
Owner

Hi @ezadEzanee

this looks like a simple problem. The compiler can not link against X11

ld: library not found for -lX11

i do not have a mac os to test this on, but i'll try to get back to you as soon as possible. did you look on stackoverflow for -lX11 issue with osx? i found this thread that seems to solve the problem at least for one user
https://stackoverflow.com/questions/42633684/ld-library-not-found-for-lx11

@ezadEzanee
Copy link
Author

Hi @mherkazandjian ,

I have resolved the error above. After running the install command again, I'm faced with another error.

clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -L/opt/X11/lib -I/usr/local/include build/temp.macosx-10.14-x86_64-3.7/fastgrab/linux_x11/screenshot.o -lX11 -lgomp -o build/lib.macosx-10.14-x86_64-3.7/fastgrab/_linux_x11.cpython-37m-darwin.so
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

I have libomp and llvm installed in my environment. Are you running openmp? I see some lines commented out in screenshot.c and setup.py. I tried removing gomp from the library and the installation managed to proceed however tox output shows the following

| => tox
py36 create: /Users/dje/fastgrab/.tox/py36
ERROR: InterpreterNotFound: python3.6
py37 create: /Users/dje/fastgrab/.tox/py37
_________________________________________________________________________________________ summary _________________________________________________________________________________________
ERROR: py36: InterpreterNotFound: python3.6
py37: commands succeeded
Traceback (most recent call last):
File "/Users/dje/.virtualenvs/GCDC/bin/tox", line 10, in
sys.exit(cmdline())
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/tox/session/init.py", line 44, in cmdline
main(args)
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/tox/session/init.py", line 68, in main
exit_code = session.runcommand()
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/tox/session/init.py", line 192, in runcommand
return self.subcommand_test()
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/tox/session/init.py", line 220, in subcommand_test
run_sequential(self.config, self.venv_dict)
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/tox/session/commands/run/sequential.py", line 9, in run_sequential
if venv.setupenv():
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/tox/venv.py", line 595, in setupenv
status = self.update(action=action)
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/tox/venv.py", line 253, in update
self.hook.tox_testenv_create(action=action, venv=self)
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/pluggy/manager.py", line 81, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
return outcome.get_result()
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/Users/dje/.virtualenvs/GCDC/lib/python3.7/site-packages/tox_pipenv/plugin.py", line 64, in tox_testenv_create
venv.session.make_emptydir(venv.path)
AttributeError: 'VirtualEnv' object has no attribute 'session'

@mherkazandjian
Copy link
Owner

hi @ezadEzanee

i also had been having trouble with the venv thing with tox. i decided to ditch it.
I moved the CI to circle CI too and i updated the readme with the minimal testing instructions without
using tox. The python py36 seems to be related to tox and venvs, not to this repo or the tox config file. Please re-test with the instruction in this branch

@dylanzenner
Copy link

has this been fixed yet? I am having this issue when trying to install on:
MacOS 11.2.3
python 3.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants