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

Cannot import javabridge undefined symbol #172

Open
ECarboni opened this issue Feb 26, 2020 · 4 comments
Open

Cannot import javabridge undefined symbol #172

ECarboni opened this issue Feb 26, 2020 · 4 comments

Comments

@ECarboni
Copy link

Hello,
I am pretty new to python but I wanted to try out bioformats and I have problems importing javabridge. I use a conda enviroment on Ubuntu and I must use python 3.7.
I did:

  • conda install bioformats
  • conda install -c bioconda java-jdk=8
  • conda install -c anaconda cython because I thought javabridge might need it
  • pip install javabridge
    If I run python -c "import javabridge" I get:
    Traceback (most recent call last):
    File "", line 1, in
    File "/.conda/envs/bioformats/lib/python3.7/site-packages/javabridge/init.py", line 38, in
    from .jutil import start_vm, kill_vm, vm, activate_awt, deactivate_awt
    File "/.conda/envs/bioformats/lib/python3.7/site-packages/javabridge/jutil.py", line 157, in
    import javabridge._javabridge as _javabridge
    ImportError:/ .conda/envs/bioformats/lib/python3.7/site-packages/javabridge/_javabridge.cpython-37m-x86_64-linux-gnu.so: undefined symbol: __intel_sse2_strchr

I am running out of ideas

@LeeKamentsky
Copy link
Owner

Hi, sorry about getting to this late.
First of all, there's an unfortunate confusion regarding bioformats. There are two packages with that name - you should do pip install python-bioformats instead of conda install bioformats. But that is beside the point.
I'm guessing it is some sort of snafu between Anaconda's compiler and the one that's the choice on your machine. See :https://stackoverflow.com/questions/49524083/importing-any-module-in-cython-file-gives-undefined-symbol-error for a similar problem.

I would try the following:

conda create -n bioformats openjdk python=3.7 numpy cython
conda activate bioformats
CC=gcc pip install javabridge
pip install python-bioformats

If it works, let me know and close the issue. Worked for me on Ubuntu 18.04.
--Lee

@zacsimile
Copy link
Contributor

I had a similar issue to @ECarboni on OSX. Tried your install instructions @LeeKamentsky and I couldn't get it to work. Output below.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/anaconda3/envs/bioformats/lib/python3.7/site-packages/bioformats/__init__.py", line 21, in <module>
    import javabridge
  File "/anaconda3/envs/bioformats/lib/python3.7/site-packages/javabridge/__init__.py", line 38, in <module>
    from .jutil import start_vm, kill_vm, vm, activate_awt, deactivate_awt
  File "/anaconda3/envs/bioformats/lib/python3.7/site-packages/javabridge/jutil.py", line 157, in <module>
    import javabridge._javabridge as _javabridge
ImportError: dlopen(/anaconda3/envs/bioformats/lib/python3.7/site-packages/javabridge/_javabridge.cpython-37m-darwin.so, 2): Symbol not found: _kCFAllocatorDefault
  Referenced from: /anaconda3/envs/bioformats/lib/python3.7/site-packages/javabridge/_javabridge.cpython-37m-darwin.so
  Expected in: flat namespace
 in /anaconda3/envs/bioformats/lib/python3.7/site-packages/javabridge/_javabridge.cpython-37m-darwin.so

@LeeKamentsky
Copy link
Owner

I don't have access to a Mac and have never been able to figure out the formula for Anaconda + Javabridge on that platform. I think it has something to do with compiling using Anaconda's JDK and running using the frameworks version. I would appreciate anyone's help in this area.

@zacsimile
Copy link
Contributor

Submitted PR #173 as a fix for my (misplaced, sorry) issue.

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

No branches or pull requests

3 participants