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

ncbiquery fuzzy support not compiled when installed via pip install #173

Open
unode opened this issue Feb 1, 2016 · 7 comments
Open

ncbiquery fuzzy support not compiled when installed via pip install #173

unode opened this issue Feb 1, 2016 · 7 comments

Comments

@unode
Copy link
Member

unode commented Feb 1, 2016

When installing ete3 with pip, the sqlite extension required for fuzzy matching (Levenshtein module) is not compiled causing code to fail.

If this is by design (sqlite-dev not a dependency), perhaps a more graceful error message could be added. It would be useful to instruct the user on what needs to be done if the code fails to find the required library.
Alternatively, the code could try to compile it on first run if not already available.

@jhcepas
Copy link
Member

jhcepas commented Feb 1, 2016

thanks @unode, we kept this feature uncompiled on purpose, to make the whole package more portable...and because almost nobody requested the feature. But now that the anaconda ete3 package is ready, we could think of distributing with this module enabled...

@unode
Copy link
Member Author

unode commented May 11, 2016

If anyone bumps into this error and is lost about what to do, the solution is to navigate to the folder .../ete3/ncbi_taxonomy/SQLite-Levenshtein/ and run make.

If no error appears (i.e. if all necessary dependencies are installed) it should create the necessary library and the code should no longer complain.

@Grelot
Copy link

Grelot commented Mar 10, 2021

Got this error with ete 3.1.2

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>

  File "/home/pguerin/miniconda3/envs/pylib_cbdr/lib/python3.9/site-packages/ete3/ncbi_taxonomy/ncbiquery.py", line 165, in get_fuzzy_name_translation
    _db.execute("select load_extension('%s')" % os.path.join(module_path,
sqlite3.OperationalError: /home/pguerin/miniconda3/envs/pylib_cbdr/lib/python3.9/site-packages/ete3/ncbi_taxonomy/SQLite-Levenshtein/levenshtein.sqlext.so: cannot open shared object file: No such file or directory

I applied the recommandation of @unode

ncbi.get_fuzzy_name_translation(name="Albula forsteri")
Trying fuzzy search for Albula forsteri

This is working fine now. Yet I would like a nice error message telling me to compile the missing feature.

@Gino091092
Copy link

@unode
I'm running into the same error, I tried running the make command but I get a fatal error.
is there any way to install the sqlite extension so it compiles fine?

This is the summary of my issue
https://www.reddit.com/r/learnpython/comments/uoefez/help_with_project_ncbi_database/

@jolespin
Copy link

jolespin commented Nov 1, 2023

(base) jespinozlt2-osx:~ jespinoz$ cd /Users/jespinoz/anaconda3/envs/soothsayer_py3.9_env2/lib/python3.9/site-packages/ete3/ncbi_taxonomy/SQLite-Levenshtein/
(base) jespinozlt2-osx:SQLite-Levenshtein jespinoz$ ls
EXAMPLE  Makefile  README  src	tests
(base) jespinozlt2-osx:SQLite-Levenshtein jespinoz$ make
gcc -Wall -shared -fPIC -Isqlite3 -o levenshtein.sqlext src/levenshtein.c
src/levenshtein.c:4:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
make: *** [levenshtein.sqlext] Error 1

@EidolaObs
Copy link

EidolaObs commented Apr 30, 2024

on MacOS ignoring the #include <malloc.h> is okay as #include <stdlib.h> is included

but going onwards attempting to make this then leads to make[2]: Nothing to be done for 'all'. and I can't seem to get any further.

Fundamentally I'm not sure this sqlite extension is able to be supported for Mac? Any help or implementation in conda would be great!

@am244
Copy link

am244 commented Jun 18, 2024

I had the same problem on Mac. I tried removing #include <malloc.h> but then ended up with the below, even though SQLite is installed (and as far as I can tell, appropriately linked).

gcc -Wall -shared -fPIC -Isqlite3 -o levenshtein.sqlext src/levenshtein.c Undefined symbols for architecture arm64: "_sqlite3_create_function", referenced from: _sqlite3_extension_init in levenshtein-9d70e6.o "_sqlite3_result_int", referenced from: _levenFunc in levenshtein-9d70e6.o "_sqlite3_result_null", referenced from: _levenFunc in levenshtein-9d70e6.o _levenFunc in levenshtein-9d70e6.o "_sqlite3_value_text", referenced from: _levenFunc in levenshtein-9d70e6.o _levenFunc in levenshtein-9d70e6.o "_sqlite3_value_type", referenced from: _levenFunc in levenshtein-9d70e6.o _levenFunc in levenshtein-9d70e6.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

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

7 participants