[libRETS-users] Python bindings not building or installing

160 views
Skip to first unread message

Wes Thomas

unread,
Jul 28, 2016, 6:16:02 PM7/28/16
to libret...@groups.realtors.org
Hello there!

I’m attempting to get the libRETS library to work for python bindings.  I followed this https://github.com/NationalAssociationOfRealtors/libRETS/blob/master/doc/build/unix.txt installation doc which resulted in the following commands:


$ sudo apt-get install -y --fix-missing \
        build-essential \
        libboost-all-dev \
        curl \
        libcurl4-gnutls-dev \
        automake \
        autoconf \
        libtool \
        xsltproc \
        libexpat-dev \
        expat \
        default-jdk \
        wget \
        git \
        antlr \
        swig \
        python-dev
        
$ ./autogen.sh
% ./configure 
% make
% sudo make install


However, python is unable to import anything:

$ python -c "import librets"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named librets


So I’m assuming that the build options are not configured correctly?




I checked for output from the build process 

ls -al /libRETS/project/swig/python
total 40
drwxrwxr-x  2 vagrant vagrant 4096 Jul 28 19:55 ./
drwxrwxr-x 11 vagrant vagrant 4096 Jul 28 19:55 ../
-rwxrwxr-x  1 vagrant vagrant 1214 Jul 28 19:55 get_object.py*
-rwxrwxr-x  1 vagrant vagrant  828 Jul 28 19:55 login.py*
-rw-rw-r--  1 vagrant vagrant 1041 Jul 28 19:55 Makefile.vc
-rwxrwxr-x  1 vagrant vagrant 2379 Jul 28 19:55 metadata.py*
-rw-rw-r--  1 vagrant vagrant  502 Jul 28 19:55 README.txt
-rwxrwxr-x  1 vagrant vagrant  530 Jul 28 19:55 rets_logging.py*
-rwxrwxr-x  1 vagrant vagrant 1409 Jul 28 19:55 search.py*
-rw-rw-r--  1 vagrant vagrant 2147 Jul 28 19:55 setup.py

And the setup.py output is the following:

$ python setup.py install
sys.platform: linux2
running install
running build
running build_py
file librets.py (for module librets) not found
file librets.py (for module librets) not found
running build_ext
building '_librets' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/home
creating build/temp.linux-x86_64-2.7/home/vagrant
creating build/temp.linux-x86_64-2.7/home/vagrant/libRETS
creating build/temp.linux-x86_64-2.7/home/vagrant/libRETS/project
creating build/temp.linux-x86_64-2.7/home/vagrant/libRETS/project/swig
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c librets_wrap.cpp -o build/temp.linux-x86_64-2.7/librets_wrap.o -I/home/vagrant/libRETS/project/librets/include -I/usr/include -I. -fPIC
x86_64-linux-gnu-gcc: error: librets_wrap.cpp: No such file or directory
x86_64-linux-gnu-gcc: fatal error: no input files
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4


Michael Sparr

unread,
Jul 28, 2016, 6:52:05 PM7/28/16
to libret...@groups.realtors.org
We are on Ubuntu 14.04 LTS and have used it successfully for Python bindings for several years. It was tricky and we now automate everything using Ansible Playbooks.  If it helps, you can fill in the blanks (variable placeholders) but these are the steps we run to install librets.

See vars snippets with list of apt-get install “packages”, several are dependencies of librets.  Then see the playbook steps to download, unpack, configure, autogen, install.  After this we are able to see it in python import.

vars:

——



tasks (playbook):

——





--
Mike Sparr
CEO and Founder
406.542.9955  office
406.531.9955  mobile
"Connecting buyers and sellers"

"Like" us on Facebook.com/goomzee
"Follow" us on Twitter.com/goomzee



Wes Thomas

unread,
Jul 28, 2016, 8:24:45 PM7/28/16
to libret...@groups.realtors.org, Michael Sparr
Very nice! I’ll try this.

43C06487-3BFD-4CC9-816B-95AFD5EEBCB5
FEDE12E6-BD9D-4EE4-A7AE-B6CD64B36AD9

Wes Thomas

unread,
Aug 4, 2016, 12:46:55 PM8/4/16
to libret...@groups.realtors.org
Michael,

Anyway you could copy/paste the text of that playbook? You'd s’ve me a ton of typing! ;-)


On July 28, 2016 at 5:52:03 PM, Michael Sparr (mi...@goomzee.com) wrote:

43C06487-3BFD-4CC9-816B-95AFD5EEBCB5
FEDE12E6-BD9D-4EE4-A7AE-B6CD64B36AD9

Michael Sparr

unread,
Aug 4, 2016, 12:52:47 PM8/4/16
to libret...@groups.realtors.org
Wes,

I did include what I could in original post (relevant tasks for librets). Other stuff in our playbooks are related to our apps and internal only. Glad to have helped and that should get you on track to build your own scripts.

I did also edit Homebrew’s formula for building librets on Mac as it was failing for me and posted a Gist here if that helps with local development (if you use brew commands):


Best,

Mike



On Aug 4, 2016, at 10:46 AM, Wes Thomas <west...@edgecaselabs.com> wrote:

Michael,

Anyway you could copy/paste the text of that playbook? You'd s’ve me a ton of typing! ;-)


On July 28, 2016 at 5:52:03 PM, Michael Sparr (mi...@goomzee.com) wrote:

We are on Ubuntu 14.04 LTS and have used it successfully for Python bindings for several years. It was tricky and we now automate everything using Ansible Playbooks.  If it helps, you can fill in the blanks (variable placeholders) but these are the steps we run to install librets.

See vars snippets with list of apt-get install “packages”, several are dependencies of librets.  Then see the playbook steps to download, unpack, configure, autogen, install.  After this we are able to see it in python import.

vars:

——

<43C06487-3BFD-4CC9-816B-95AFD5EEBCB5>


tasks (playbook):

——

<FEDE12E6-BD9D-4EE4-A7AE-B6CD64B36AD9>

Michael Sparr

unread,
Aug 4, 2016, 12:55:38 PM8/4/16
to libret...@groups.realtors.org
I see what you mean about copy/paste. I shared screenshots before…  Here you go, you lazy typer! ;-)


vars file:

packages:
    - antlr
    - autoconf
    - build-essential
    - git
    - libboost-all-dev
    - libcurl4-openssl-dev
    - libevent-dev
    - libfreetype6
    - libfreetype6-dev
    - libjpeg-dev
    - libjpeg8-dev
    #- python
    #- python-dev
    #- python-pip
    - python-gdal
    - supervisor
    - swig
    - zlib1g-dev



tasks file:

    - name: Download librets (dependency)
      get_url: url={{ librets_url }}/{{ librets_name }}.tar.gz
               dest={{ librets_path }}/{{ librets_name }}.tar.gz validate_certs=no
               #sha256sum=30216f2640c3fa05c362caad823b8abf839e8f880b18dc10bf517fc791f03ab7
      register: downloaded_librets

    - name: Unpack librets (dependency)
      command: tar -xf {{ librets_name }}.tar.gz
               chdir=/{{ librets_path }}
               creates={{ librets_path }}/{{ librets_folder }}
      when: downloaded_librets.changed

    - debug: msg="Librets changed! Using path {{ librets_path }} and folder {{ librets_folder }}"
      #when: downloaded_librets.changed

    - name: Autoconfigure application
      command: ./autogen.sh
               chdir={{ librets_path }}/{{ librets_folder }}
      sudo: yes
      when: downloaded_librets.changed

    - name: Configure librets (dependency)
      command: ./configure --disable-perl --disable-dotnet --disable-ruby --disable-php --enable-shared_dependencies
               chdir={{ librets_path }}/{{ librets_folder }}
      when: downloaded_librets.changed

    - name: Build librets (dependency)
      command: make chdir={{ librets_path }}/{{ librets_folder }}
      when: downloaded_librets.changed

    - name: Install librets (dependency)
      command: make install chdir={{ librets_path }}/{{ librets_folder }}
      when: downloaded_librets.changed

Wes Thomas

unread,
Aug 4, 2016, 1:00:28 PM8/4/16
to libret...@groups.realtors.org, Michael Sparr
YES. Thank you :-)

Wes Thomas

unread,
Aug 4, 2016, 4:40:07 PM8/4/16
to libret...@groups.realtors.org
I finally got the ansible script running properly without error. However, python still can’t import librets. :-(

Here’s the script:



Can anyone give some insight on how to tell if the make command is installing the binaries properly?


Reply all
Reply to author
Forward
0 new messages