bgslibrary
bgslibrary copied to clipboard
Python: ImportError: No module named libbgs
Hello,
I have compiled the library using:
git clone https://github.com/andrewssobral/bgslibrary.git cd build cmake -D BGS_PYTHON_SUPPORT=ON .. make
no errors in making, added to the python path:
`>>> import sys
from pprint import pprint as pp pp(sys.path) ['', '/home/user/bgslibrary/build/libbgs.so', '/home/user/bgslibrary', '/usr/lib/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib/python2.7/site-packages']`
I tried many adds into the path: 'libbgs.so', '/home/user/bgslibrary/build/libbgs.so', '/home/user/bgslibrary',
But still have the error :
[user@localhost bgslibrary]$ python Demo.py
Traceback (most recent call last):
File "Demo.py", line 3, in
OS: Fedora 25
Any suggestions?
Thanks,
I have the same problem, have you solved it? @fasni
@fasni You need to point to the build directory where you made the bgslibrary software:
export PYTHONPATH="${PYTHONPATH}:$HOME/myapps/bgslibrary/build"
Same problem. Sometimes it works, but most of the time I can't import module
import sys sys.path.append('/home/denis/bgslibrary/build')
Pointing doesn't work fine for me, but this lane into your code help me to execute it anywhere.
Now with the migration to pybind11 I think this issue was solved
It's works.
Add this at the top of script.
import os
import sys
sys.path.append(os.getcwd() + '/build')
Same here even i tried all the above solutions. Which file from build folder is needed ?
Same here even i tried all the above solutions. Which file from build folder is needed ?
Well, you can backup the original folder and delete some files for testing. According to my tests, following files are required:
bgs.cp36-win_amd64.pyd
bgs.exp
bgs.lib
bgslibrary_core.dll
bgslibrary_core.exp
bgslibrary_core.lib
And, .vs
is a hidden folder under the bulid
folder, which takes up quite a bit of disk.