openai / deeptype

Code for the paper "DeepType: Multilingual Entity Linking by Neural Type System Evolution"
https://arxiv.org/abs/1802.01021
Other
649 stars 146 forks source link

Unable to install the wikidata_linker_utils_src #36

Closed heisenbugfix closed 6 years ago

heisenbugfix commented 6 years ago

I tried installing wikidata_linker_utils_src using the command pip install wikidata_linker_utils_src/ I got the following error. Can someone please help me out? @JonathanRaiman P.S I am using Cython version 0.26 as pointed out in the other issues. I am doing my installation in Ubuntu. I also tried it on Windows.

Error compiling Cython file:
------------------------------------------------------------
...
        filename_byte_string = path.encode("utf-8")
        cdef char* fname = filename_byte_string
        cdef FILE* cfile
        cfile = fopen(fname, "rb")
        if cfile == NULL:
            raise FileNotFoundError(2, "No such file: '%s'" % (path,))
                                  ^
------------------------------------------------------------

src/cython/wikidata_linker_utils/successor_mask.pyx:41:35: undeclared name not builtin: FileNotFoundError
building 'wikidata_linker_utils.successor_mask' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c /mnt/mydir/deeptype/wikidata_linker_utils_src/src/cython/wikidata_linker_utils/successor_mask.cpp -o build/temp.linux-x86_64-2.7/mnt/mydir/deeptype/wikidata_linker_utils_src/src/cython/wikidata_linker_utils/successor_mask.o -std=c++11 -Wno-unused-function -Wno-sign-compare -Wno-unused-local-typedef -Wno-undefined-bool-conversion -O3 -Wno-reorder
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
/mnt/mydir/deeptype/wikidata_linker_utils_src/src/cython/wikidata_linker_utils/successor_mask.cpp:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
 #error Do not use this file, it is the result of a failed Cython compilation.
  ^
cc1plus: warning: unrecognized command line option '-Wno-undefined-bool-conversion'
cc1plus: warning: unrecognized command line option '-Wno-unused-local-typedef'
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
JonathanRaiman commented 6 years ago

@heisenbugfix I've only run this with Python 3.5/3.6. You seem to be using 2.7, so the exception is probably named differently there. I would suggest installing with Python 3

heisenbugfix commented 6 years ago

Thank you so much :)

YerongLi commented 3 years ago

I tried python3.5/3.6/3.7, it is still not working, anyone can help me with this:

  Processing ./deeptype/wikidata_linker_utils_src
  Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (from wikidata-linker-utils==1.0.0) (1.20.2)
  Building wheels for collected packages: wikidata-linker-utils
    Building wheel for wikidata-linker-utils (setup.py): started
    Building wheel for wikidata-linker-utils (setup.py): finished with status 'error'
    Running setup.py clean for wikidata-linker-utils
  Failed to build wikidata-linker-utils
  Installing collected packages: wikidata-linker-utils
      Running setup.py install for wikidata-linker-utils: started
      Running setup.py install for wikidata-linker-utils: finished with status 'error'

  Python 3.5.6 :: Anaconda, Inc.
    ERROR: Failed building wheel for wikidata-linker-utils
  ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-aplyqnv3/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-aplyqnv3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wn2ty7kd/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/wikidata-linker-utils Check the logs for full command output.