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

MacOS: Compiled successfully, but module is missing #53

Open
fhamborg opened this issue Feb 9, 2017 · 3 comments
Open

MacOS: Compiled successfully, but module is missing #53

fhamborg opened this issue Feb 9, 2017 · 3 comments

Comments

@fhamborg
Copy link

fhamborg commented Feb 9, 2017

I'm on MacOS 10.12.3 and followed the hints in the other issue on failing MacOS compilation (#19). Finally, I was able to get the compilation and python package setup run through, but I still cannot use the parser.

fxa:~ felix$ python3
Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import bllipparser
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bllipparser-2016.9.11-py3.6-macosx-10.6-intel.egg/bllipparser/CharniakParser.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 560, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bllipparser-2016.9.11-py3.6-macosx-10.6-intel.egg/bllipparser/_CharniakParser.cpython-36m-darwin.so, 2): no suitable image found.  Did find:
	/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bllipparser-2016.9.11-py3.6-macosx-10.6-intel.egg/bllipparser/_CharniakParser.cpython-36m-darwin.so: mach-o, but wrong architecture

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bllipparser-2016.9.11-py3.6-macosx-10.6-intel.egg/bllipparser/__init__.py", line 399, in <module>
    from .RerankingParser import RerankingParser, Tree, Sentence, tokenize
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bllipparser-2016.9.11-py3.6-macosx-10.6-intel.egg/bllipparser/RerankingParser.py", line 19, in <module>
    from . import CharniakParser as parser
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bllipparser-2016.9.11-py3.6-macosx-10.6-intel.egg/bllipparser/CharniakParser.py", line 17, in <module>
    _CharniakParser = swig_import_helper()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bllipparser-2016.9.11-py3.6-macosx-10.6-intel.egg/bllipparser/CharniakParser.py", line 16, in swig_import_helper
    return importlib.import_module('_CharniakParser')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_CharniakParser'
>>>
@dmcc
Copy link
Member

dmcc commented Feb 10, 2017

Sadly, I'm no expert on building BLLIP on Mac OS X (still). Is http://stackoverflow.com/questions/26958232/need-help-wrong-architecture-causing-app-to-crash-when-launching-in-ios-7-but helpful?

@fhamborg
Copy link
Author

Unfortunately not, but I managed to avoid this problem by basically performing PyCharm remote development, i.e., I setup a Ubuntu VM which is now controlled by PyCharm. The code is executed on that VM rather than on MacOS. It's not good, but it works. I followed this guide: https://blog.jetbrains.com/pycharm/2015/03/feature-spotlight-python-remote-development-with-pycharm/

@namkhanhtran
Copy link

namkhanhtran commented May 26, 2017

here is what I did to solve this problem on Mac el Capitan

  1. of course, install swig with brew: brew install swig
  2. in order to run: make (to compile), I need to specify the CC and CXX as stated in the README: CC=/usr/lib/bin/gcc-7 and CXX=/usr/lib/bin/g++-7
  3. I tried to install the python package using pip install bllipparser, but got the same error. So, I decided to install from source code with python setup.py install. But the trick here is that I NEED to use the default CC and CXX (just open a new terminal :- ) )
  4. Probably, one error (Expected in: flat namespace) will be returned, just add “‘-stdlib=libc++’” when building reranker_module in setup.py, instead of c++11. (https://stackoverflow.com/questions/16880571/why-does-clang-lack-forward-list)

Good luck ;-)

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

No branches or pull requests

3 participants