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

python 3.6 librebound.cpython-36m-x86_64-linux-gnu.so import error #26

Closed
Yeqzids opened this issue Apr 5, 2018 · 10 comments
Closed

python 3.6 librebound.cpython-36m-x86_64-linux-gnu.so import error #26

Yeqzids opened this issue Apr 5, 2018 · 10 comments

Comments

@Yeqzids
Copy link

Yeqzids commented Apr 5, 2018

import reboundx gives me OSError: librebound.cpython-36m-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory unless I do it under the python3.6/site-packages directory. Anyone has this error? I almost suspect I missed something obvious...

python 3.6.5
rebound 3.5.12, reboundx 2.18.1 installed via pip

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-58-227e1b4154d8> in <module>()
      7  
      8 
----> 9 import reboundx
     10 rebx = reboundx.Extras(sim)
     11 rf = rebx.add("radiation_forces")

~/anaconda3/lib/python3.6/site-packages/reboundx/__init__.py in <module>()
     11 pymodulespath = os.path.dirname(__file__)
     12 from ctypes import *
---> 13 clibreboundx = cdll.LoadLibrary(pymodulespath + '/../libreboundx' + suffix)
     14 
     15 # Version

~/anaconda3/lib/python3.6/ctypes/__init__.py in LoadLibrary(self, name)
    424 
    425     def LoadLibrary(self, name):
--> 426         return self._dlltype(name)
    427 
    428 cdll = LibraryLoader(CDLL)

~/anaconda3/lib/python3.6/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    346 
    347         if handle is None:
--> 348             self._handle = _dlopen(self._name, mode)
    349         else:
    350             self._handle = handle

OSError: librebound.cpython-36m-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory
@dtamayo
Copy link
Owner

dtamayo commented Apr 5, 2018

Are you using a virtual environment (or conda environment)? If not I definitely recommend doing that. If you are not familiar with it, there are instructions at the top of here:
http://rebound.readthedocs.io/en/latest/python_quickstart.html

@Yeqzids
Copy link
Author

Yeqzids commented Apr 5, 2018

I am using conda, but my reboundx is installed via pip because there is no conda package for Linux. I will try virtualenv to see if it helps. Thanks!

@dtamayo
Copy link
Owner

dtamayo commented Apr 6, 2018

you can pip install into a conda environment (that's what I do). Let me know if it resolves the issue

@Yeqzids
Copy link
Author

Yeqzids commented Apr 6, 2018

Yes, this solved my problem. Thanks!

@Yeqzids Yeqzids closed this as completed Apr 6, 2018
@Yeqzids
Copy link
Author

Yeqzids commented Apr 26, 2018

In case anyone runs into similar problems like me... upgrade rebound (not reboundx) to 3.5.13 appears to solve the problem.

dtamayo pushed a commit that referenced this issue Jul 13, 2020
Fork sync with upstream
dangcpham pushed a commit to dangcpham/reboundx_custom that referenced this issue Nov 7, 2023
Fork sync with upstream

Former-commit-id: 56e328c
@pavlikva
Copy link

pavlikva commented Apr 9, 2024

I had the same error with Python_3.10, Rebound_4.3.2 and Reboundx_4.1.0, but it was solved by putting this line in my .bashrc file
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/.local/lib/python3.10/site-packages"

@GumballWatterso
Copy link

@pavlikva where do I put this in my .bashrc file in order to resolve this error, I am having the exact same issue as you are right now with Python_3.10, Rebound_4.3.2 and Reboundx_4.1.0.

@pavlikva
Copy link

Anywhere. I put it at the end. Then reload bash.

@GumballWatterso
Copy link

GumballWatterso commented Apr 13, 2024

@pavlikva ,it still did not work, I put it at the end of the .bashrc file, and then reload it using the command source ~/.bashrc. Did I do something wrong?

@kgozdziewski
Copy link

It works, after adding the PATH variable.

Does echo $SHELL gives you /bin/bash? If your shell is different, then the path variable must be consistent with the shell syntax.

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

5 participants