Closed fligi7 closed 6 years ago
make install
?)Yes, ran both make
and make install
. No pypff to be found...
$ ls -l /usr/lib/python3.5/site-packages/ | grep pypff Nothing found. $ ls -l /usr/lib/python2.7/site-packages/ | grep pypff Nothing found.
What does the output of make install
tell you where pypff.so is installed?
make install
...
/bin/mkdir -p '/usr/local/lib' /bin/sh ../libtool --mode=install /bin/install -c libpff.la '/usr/local/lib' libtool: install: /bin/install -c .libs/libpff.so.1.0.0 /usr/local/lib/libpff.so.1.0.0 libtool: install: (cd /usr/local/lib && { ln -s -f libpff.so.1.0.0 libpff.so.1 || { rm -f libpff.so.1 && ln -s libpff.so.1.0.0 libpff.so.1; }; }) libtool: install: (cd /usr/local/lib && { ln -s -f libpff.so.1.0.0 libpff.so || { rm -f libpff.so && ln -s libpff.so.1.0.0 libpff.so; }; }) libtool: install: /bin/install -c .libs/libpff.lai /usr/local/lib/libpff.la libtool: install: /bin/install -c .libs/libpff.a /usr/local/lib/libpff.a libtool: install: chmod 644 /usr/local/lib/libpff.a libtool: install: ranlib /usr/local/lib/libpff.a libtool: finish: PATH="/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /usr/local/lib
Libraries have been installed in: /usr/local/lib
Can you try:
./configure --prefix /usr/ --enable-python
make
sudo make install
That seemed to work. Any ideas what happened to prevent this in the future?
What I assume is that pypff.so might have been installed under /usr/local/
.
Though this appears to have successfully installed for python2.7, it does not appear to have installed for python3.
$ python2.7
Python 2.7.13 (default, May 10 2017, 20:04:36)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
$ import pypff
$ exit()
$ python3
Python 3.5.3 (default, May 11 2017, 09:10:41)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
$ import pypff
Traceback (most recent call last):
File "$ exit()
How might I get the python3 bindings installed?
@fligi7 try running ./configure --prefix /usr/ --with-python --with-python3
before running make
and make install
Assuming questions have been answered closing issue
Sorry for not seeing this. I tried it again per https://github.com/libyal/libpff/issues/52#issuecomment-378676492.
While it works for importing pypff in interactive python mode (as I did here https://github.com/libyal/libpff/issues/52#issuecomment-373797742), it still produces an ImportError when used in a python program.
So, not sure what all is going on here.
My guess your Python configuration is not able to find pypff.so. You'll need to compile the bindings for both Python 2 and 3 and install it in the python version specific site-packages / dist-packages directory (for both Python versions independently). Running python -vv
will give you more debug output, that might hint what is going on.
Otherwise try inside a virtualenv
, pip install libpff-python
Hey I had this issue but found that on ubuntu (18.04) moving the module from "python3" to "python3.6" fixed the import error. When I had an interactive prompt it use the "python3" path as noted by fligi7.
sudo cp /usr/local/lib/python3/dist-packages/pypff.* /usr/local/lib/python3.6/dist-packages/
fixed this for me (in scripts)
I have successfully implemented binding on Ubuntu 19.10, however at windows 10 there exist an error after the commands below. Any help will be appreciated.
Thanks
Commands: cd libpff ./synclibs.sh ./autogen.sh ./configure --prefix /usr/ --with-python –with-python3 Error: to use local version... (cached) auto-detect ./configure: line 15879: syntax error near unexpected token newline' ./configure: line 15879: PKG_CHECK_MODULES('
@apdullahyayik
Specifying to build Python bindings as specified here. However, it's not working as expected.
This is on Fedora 24 with Linux 4.11.12-100.fc24.x86_64 x86_64 kernel.
Any ideas what's going wrong here?