-
Notifications
You must be signed in to change notification settings - Fork 36
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
Problem with pip install on MacOS #33
Comments
Could you try the given solution in that ticket: #26 (the last comment) |
Thanks! It seems to work but when I import it on python cli it shows this message:
I'm using Python 2.7 not 3. |
That's a completly new error to me… :( Are you stuck to python2 due to an integration to a project or can you move forward to python3? It's the perfect time! :) I flag the issue with "help-needed" label but I cannot do much more for now. |
Same error with Python 3:
|
Hello, I just managed to install pyhunspell on a clean macOS High Sierra by following these steps: installed homebrew update user path (make sure to be using pip and python from the home brew installation) brew install hunspell (currently on version 1.6.2, so, adjusting the linking found on comment #26:) ln -s /usr/local/Cellar/hunspell/1.6.2/lib/libhunspell-1.6.0.dylib /usr/local/Cellar/hunspell/1.6.2/lib/libhunspell.dylib CFLAGS=$(pkg-config --cflags hunspell) LDFLAGS=$(pkg-config --libs hunspell) pip install hunspell -> no problem using hunspell |
Hi, This particular solution didn't work for me on Sierra I needed to modify the setup.py file with the mentioned flags. I followed the same steps, installed homebrew, python, and hunspell then adjusted the linking with:
After I cloned this repository I edited this part of the setup.py file like this:
Running this with |
I have the same problem as @thiagolcks - "Expected in: flat namespace". Any solution to that? |
I get the same input error as @thiagolcks and @kosta-blank. Is there any other way to resolve this issue? |
I'm experiencing the same problem, thiagolcks, kosta-blank and LittleEntertainer :) |
Still no mean for me to dig into that. (No Mac near me, and not happening in the near future I'm afraid) If anyone is finding a way to overcome this issue please comment here. |
Hello @blatinier et al.! So I tried solutions by @gbrabelo (partially, because I am using conda python3) and @valerK but to no success :( Here's the output of a "successful" installation (on macOS High Sierra) via running install
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mpopov/anaconda3/include -arch x86_64 -I/Users/mpopov/anaconda3/include -arch x86_64 -I/usr/local/Cellar/hunspell/1.6.2/include/hunspell/ -I/Users/mpopov/anaconda3/include/python3.6m -c hunspell.cpp -o build/temp.macosx-10.7-x86_64-3.6/hunspell.o
hunspell.cpp:144:30: warning: 'spell' is deprecated [-Wdeprecated-declarations]
retvalue = self->handle->spell(word);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:131:3: note: 'spell' has been explicitly marked deprecated here
H_DEPRECATED int spell(const char* word, int* info = NULL, char** root = NULL);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:164:31: warning: 'suggest' is deprecated [-Wdeprecated-declarations]
num_slist = self->handle->suggest(&slist, word);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:141:3: note: 'suggest' has been explicitly marked deprecated here
H_DEPRECATED int suggest(char*** slst, const char* word);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:175:19: warning: 'free_list' is deprecated [-Wdeprecated-declarations]
self->handle->free_list(&slist, num_slist);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:155:3: note: 'free_list' has been explicitly marked deprecated here
H_DEPRECATED void free_list(char*** slst, int n);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:193:31: warning: 'analyze' is deprecated [-Wdeprecated-declarations]
num_slist = self->handle->analyze(&slist, word);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:164:3: note: 'analyze' has been explicitly marked deprecated here
H_DEPRECATED int analyze(char*** slst, const char* word);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:204:19: warning: 'free_list' is deprecated [-Wdeprecated-declarations]
self->handle->free_list(&slist, num_slist);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:155:3: note: 'free_list' has been explicitly marked deprecated here
H_DEPRECATED void free_list(char*** slst, int n);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:222:31: warning: 'stem' is deprecated [-Wdeprecated-declarations]
num_slist = self->handle->stem(&slist, word);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:168:3: note: 'stem' has been explicitly marked deprecated here
H_DEPRECATED int stem(char*** slst, const char* word);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:233:19: warning: 'free_list' is deprecated [-Wdeprecated-declarations]
self->handle->free_list(&slist, num_slist);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:155:3: note: 'free_list' has been explicitly marked deprecated here
H_DEPRECATED void free_list(char*** slst, int n);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:251:31: warning: 'generate' is deprecated [-Wdeprecated-declarations]
num_slist = self->handle->generate(&slist, word1, word2);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:181:3: note: 'generate' has been explicitly marked deprecated here
H_DEPRECATED int generate(char*** slst, const char* word, const char* word2);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:263:19: warning: 'free_list' is deprecated [-Wdeprecated-declarations]
self->handle->free_list(&slist, num_slist);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:155:3: note: 'free_list' has been explicitly marked deprecated here
H_DEPRECATED void free_list(char*** slst, int n);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:282:31: warning: 'generate' is deprecated [-Wdeprecated-declarations]
num_slist = self->handle->generate(&slist, word1, &desc, 1);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:191:3: note: 'generate' has been explicitly marked deprecated here
H_DEPRECATED int generate(char*** slst, const char* word, char** desc, int n);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
hunspell.cpp:294:19: warning: 'free_list' is deprecated [-Wdeprecated-declarations]
self->handle->free_list(&slist, num_slist);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:155:3: note: 'free_list' has been explicitly marked deprecated here
H_DEPRECATED void free_list(char*** slst, int n);
^
/usr/local/Cellar/hunspell/1.6.2/include/hunspell/hunspell.hxx:89:39: note: expanded from macro 'H_DEPRECATED'
# define H_DEPRECATED __attribute__((__deprecated__))
^
11 warnings generated.
creating build/lib.macosx-10.7-x86_64-3.6
g++ -bundle -undefined dynamic_lookup -L/Users/mpopov/anaconda3/lib -arch x86_64 -L/Users/mpopov/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/hunspell.o -lhunspell -o build/lib.macosx-10.7-x86_64-3.6/hunspell.cpython-36m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
running install_lib
copying build/lib.macosx-10.7-x86_64-3.6/hunspell.cpython-36m-darwin.so -> /Users/mpopov/anaconda3/lib/python3.6/site-packages
running install_egg_info
Writing /Users/mpopov/anaconda3/lib/python3.6/site-packages/hunspell-0.5.0-py3.6.egg-info When I try to import hunspell
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/mpopov/anaconda3/lib/python3.6/site-packages/hunspell.cpython-36m-darwin.so, 2): Symbol not found: __ZN8Hunspell14add_with_affixERKSsS1_
Referenced from: /Users/mpopov/anaconda3/lib/python3.6/site-packages/hunspell.cpython-36m-darwin.so
Expected in: flat namespace
in /Users/mpopov/anaconda3/lib/python3.6/site-packages/hunspell.cpython-36m-darwin.so My hunspell library looks like this: $ echo $(pkg-config --cflags hunspell)
# -I/usr/local/Cellar/hunspell/1.6.2/include/hunspell
$ ls /usr/local/Cellar/hunspell/1.6.2/include/hunspell
# atypes.hxx csutil.hxx htypes.hxx hunspell.h hunspell.hxx hunvisapi.h w_char.hxx
$ echo $(pkg-config --libs hunspell)
# -L/usr/local/Cellar/hunspell/1.6.2/lib -lhunspell-1.6
$ ls /usr/local/Cellar/hunspell/1.6.2/lib
# libhunspell-1.6.0.dylib libhunspell-1.6.a libhunspell-1.6.dylib libhunspell.a libhunspell.dylib pkgconfig Here's additional information if it could be useful:
|
In the hope this is helpful, here are the commands through which I was able to successfully compile and run Environment:
After successful creation of Testing that it works:
|
Ok anymore positive output for this? @thiagolcks @kosta-blank @LittleEntertainer @MVilstrup @bearloga ? |
@blatinier Nope :( I tried replicating @workflowsguy's steps but I'm still getting an error when trying to load pyhunspell:
Environment:
|
Did you create the links suggested (the |
Yup! Sorry, I forgot to include that I created the symbolic links too. I think I ran the post install |
I hit the same issue. I noticed this in the clang command
after this, hunspell seemed to work:
|
Ok could some of you try to |
works for me. it might be nice to also check some environment variable for the hunspell directory (C_INCLUDE_PATH?) in case someone has a different version (and mention it in the mac install notes. |
Ok it's merged in the master branch. I will publish on pypi soon. |
Hi, does any one have any updates on the issue about the error:
I have tried to get over this error by checking different versions of the hunspell library, installing with pip, and also compiling hte cloned repository myself ... but I was not able to get rid of the error. |
pypi version was updated regarding this issue at the end of january. If yes could you indicate your python version, macos version, hunspell version et full stacktraces? |
Thanks, I get the problem with the following system:
Compilation from the downloaded code works fine after correcting some links and updating Importing hunspell in ipython gives the following error:
|
I reopen the subject then, but I still don't own a Mac so troubleshooting this is not possible for me... |
I have been facing the same error since the past week. And I finally found a hack that worked for me. My initial system config was: I tried all suggestions as mentioned in this thread, but they did not work. Clearly the .so file being generated while pip installing hunspell, was buggy. A colleague of mine, who wasn't using miniconda/anaconda, was able to import hunspell without issues following the install instructions mentioned in the above comments. I decided to inspect the correct and the buggy .so file for clues. So I used Buggy file had:
Correct file had:
The difference - correct .so file uses I removed miniconda and used brew installed python. That still did not solve the problem. So finally, I cloned the pyhunspell repo and ran This file had the same contents as the correct .so file and I replaced the buggy one with this. Like I mentioned before this is clearly a hack - if anyone can shed more light on how to ensure the .so file generated in a pip install should have |
@soumyagk I see why this solution should work, but I can't build a copy of the .so that references |
Here's a dropbox link : https://www.dropbox.com/s/7p0tynwdgchhwcj/hunspell.cpython-36m-darwin.so?dl=0 |
I followed all the instructions that @valerK provided, but still had an error. Then I tried what @soumyagk recommended and got this error:
It looks like it can't create the .so file that I need - and neither can I. These are the list of files I have:
Can anyone tell me how to manually create the .so file or any other advice? Thank you! |
I can't remember now if I ran a different command from |
As suggested @workflowsguy I managed to install pyhunspell 0.5.5 from the latest version Hunspell (1.7.0) on Python 3.7.3 by running these commands:
Hope this helps. |
@sam1902, these instructions failed with:
I should note that all other C extensions compile properly. Xcode tools are updated and everything. Python 3.7.4 via homebrew It's wild to me that This might be due to Moajve: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes Has anyone gotten this to work on 10.14? |
I was able to fix this. I first needed to install XCode 11
I noticed this in my error message:
For some reason, it appeared to be looking for |
@emorikawa this is a macOs 10.14 specific issue with XCode as you mentionned. Symlinking does fix it for me too, but this xcode update breaks many others pip packages too. |
This worked for me :) |
For anyone who is still struggling with this in 2024 on an Apple Silicon (arm) Mac, these are the changes I made to get Preliminary (assume you've done this already)
Main
|
I'm using MacOS Sierra and after run
brew install hunspell
and `pip install hunspell' I'm getting:I also run
ln -s /usr/local/lib/libhunspell-1.6.a /usr/local/lib/libhunspell.a
but it didn't help.The text was updated successfully, but these errors were encountered: