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

Linking to Anaconda environment in Ubuntu #223

Open
mariobecerra opened this issue Mar 23, 2020 · 3 comments
Open

Linking to Anaconda environment in Ubuntu #223

mariobecerra opened this issue Mar 23, 2020 · 3 comments

Comments

@mariobecerra
Copy link

Hi.

Is there a guide on how to direct the Arrayfire installation to an Anaconda environment? I saw a couple of issues here, but they were based on Windows and Mac OS. I'm working with Ubuntu 19.10.

If I try to import Arrayfire in Python I get the following:

>>> import arrayfire
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mario/anaconda3/lib/python3.7/site-packages/arrayfire/__init__.py", line 56, in <module>
    from .library    import *
  File "/home/mario/anaconda3/lib/python3.7/site-packages/arrayfire/library.py", line 643, in <module>
    backend = _clibrary()
  File "/home/mario/anaconda3/lib/python3.7/site-packages/arrayfire/library.py", line 619, in __init__
    raise RuntimeError("Could not load any ArrayFire libraries.\n" + more_info_str)
RuntimeError: Could not load any ArrayFire libraries.
Please look at https://github.com/arrayfire/arrayfire-python/wiki for more information.

You can see that it's trying to look for Arrayfire in the anaconda3 folder, and it is obviously failing because my Arrayfire installation is in /opt/arrayfire/.

Any pointers to how I can fix this?

@umar456
Copy link
Member

umar456 commented Mar 23, 2020

Python cannot fine the ArrayFire shared library. You can try to define the AF_PATH environment variable or add the ArrayFire library path in LD_LIBRARY_PATH.

@mariobecerra
Copy link
Author

I tried the first option. I added export AF_PATH="/opt/arrayfire/" in my bashrc file and sourced it. However, if I try to import the arrayfire package in Python I get the same error. I'm not sure exactly how to tell Python to use that variable. Any ideas?

Sorry about this, I'm really bad at doing all this environment variables and shared libraries stuff.

@umar456
Copy link
Member

umar456 commented Mar 23, 2020

Try setting LD_LIBRARY_PATH to the location of the libafcpu.so. so in your case export LD_LIBRARY_PATH=/opt/arrayfire/lib64:$LD_LIBRARY_PATH

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

2 participants