-
Notifications
You must be signed in to change notification settings - Fork 60
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
Symbol not found: _libiconv #2
Comments
Hi @ozak I am a bit on the dark as I do not have a machine with OSX to test. What I can tell is that libiconv is not a python library but a C library. Try installing it with homebrew to see if that solves the problem. Something like this: Please let me know if that solves the issue, in order to mention it in the documentation. If that does not solve it, from the top of my head, in setup.py there is a line: The problem is that it finds it during compilation but later not anymore when importing the solution is either installing a version it can later find (first suggestion) or tell it how to find the one already there (second suggestion) |
@ofajardo Thanks for the suggestions....Sadly, I already had extensions = [Extension("pyreadstat.pyreadstat",
sources=["pyreadstat/pyreadstat" + ext] + sources,
# this dot here is important for cython to find the pxd files
include_dirs = [source_dir_root] + source_dirs + ["pyreadstat", "."],
libraries=libraries,
extra_compile_args=["-Ireadstat", "-DHAVE_ZLIB=1",
"-I/ANACONDADIR/include",
"-I/ANACONDADIR/lib"] ),
Extension("pyreadstat._readstat_parser",
sources=["pyreadstat/_readstat_parser" + ext] + sources,
include_dirs = [source_dir_root] + source_dirs + ["pyreadstat", "."],
libraries=libraries,
extra_compile_args=["-Ireadstat", "-DHAVE_ZLIB=1",
"-I/ANACONDADIR/include",
"-I/ANACONDADIR/lib"] )] This should solve the issue for anyone who wants to compile it. Not sure why you have the commands repeated though. Also not sure how to force it to find the ANACONDADIR or how to provide the program with the directory where this is to be found so that it could work with |
@ozak brilliant! I am very happy that you managed to solve it. I have asked another mac user and he said that he managed to install directly from pip without issue, so it seems that it is not a general problem. My guess he somehow had already libiconv on his system because of having installed it before with another application. I will see if I can discover more. One simple thing that may work tough is the following: on windows what I did is to ship libiconv together with pyreadstat, in that way nothing needs to be installed in addition and pip is enough. Maybe that could be useful in this case as well? If you had some time, you could (in a new clean environment) try to install pyreadstat again, confirm that you get the error, and then just copy libiconv together with the the pyreadstat files in site packages and see if that cures the problem. If it does, then I could just add that file to the package-data as I do on windows. What do you think? |
@ofajardo I am not sure what the issue is in that case. Since I had libiconv installed on both versions before installing |
@ofajardo it seems it works, at least if you |
@ozak thanks a lot for testing. I also tested with couple more users and it was working. For one it was OK with the system libraries, but for one it was necessary to install the libiconv from conda because the system libraries were old. I will prepare a new Pypi package so that it can be installed with pip. For now I will suggest in the documentation that if there are problems with libiconv a first thing to try is to install it from conda and try to compile again. Later I will check on how to do a conda pacakge/recipe as you suggested. For the records: In order for pyreadstat to work on Mac, it was necessary to do a static linking for iconv. Setup.py was modified for this purpose (static linking is necessary also for windows, but not for linux as iconv seems to be part of the gclib library and not a separate shared library). Useful notes:
how to check a shared library version:
|
@ozak a new version is out in PyPi (0.1.8). If you get an opportunity to test it, let me know if it works. |
Closed after 1 month of inactivity. If anybody else has a similar issue please open a new ticket. |
@ofajardo thanks for working on this!
I have been trying to make it work in a conda environment with
pyton3.5
on two separate OSX systems and I always get the same error. I also tried installing in the homebrew version of python with similar results. I tried the simplepip install
, also from Github, compiling from scratch...nothing. Any ideas what it could be? I do seelibiconv
in theconda list
.The text was updated successfully, but these errors were encountered: