0

System : Mac OSX Latest

I installed xapian-core using ports -

> Aarons-MacBook-Air:plugin aaron$ sudo port install xapian-core
> ---> Computing dependencies for xapian-core
> ---> Fetching archive for xapian-core
> ---> Attempting to fetch xapian-core-1.2.8_1.darwin_13.x86_64.tbz2 from http://packages.macports.org/xapian-core
> ---> Attempting to fetch xapian-core-1.2.8_1.darwin_13.x86_64.tbz2 from
> http://mse.uk.packages.macports.org/sites/packages.macports.org/xapian-core
> ---> Attempting to fetch xapian-core-1.2.8_1.darwin_13.x86_64.tbz2 from http://nue.de.packages.macports.org/macports/packages/xapian-core
> ---> Fetching distfiles for xapian-core
> ---> Attempting to fetch xapian-core-1.2.8.tar.gz from http://distfiles.macports.org/xapian-core
> ---> Verifying checksums for xapian-core
> ---> Extracting xapian-core
> ---> Configuring xapian-core
> ---> Building xapian-core
> ---> Staging xapian-core into destroot
> ---> Installing xapian-core @1.2.8_1
> ---> Activating xapian-core @1.2.8_1
> ---> Cleaning xapian-core
> ---> Updating database of binaries: 100.0%
> ---> Scanning binaries for linking errors: 100.0%
> ---> No broken files found.

I then opened vim and tried to open nvim using :Nvim. I received some errors -

> Error detected while processing function NVIM_init...10_DefPython:
> Traceback (most recent call last): File
> "/Users/Aaron/.vim/plugin/python/nvim.py", line 3 import xapian
> ImportError: No module named xapian

Could some one please let me know what I need to do to get Nvim to recognize that I have installed xapian. I am guessing I need to point the import xapian inside nvim.py at a "hard coded" address. Something like

import /usr/libs/xapian

Can someone let me know if I am on the right track or if there is an easier way to get the system to understand where xapian is located now for vim?

Assem
  • 11,574
  • 5
  • 59
  • 97
ILikeTurtles
  • 1,012
  • 4
  • 16
  • 47
  • Did you try the xapian-bindings package? – romainl May 20 '14 at 20:55
  • @romainl I tried to install the bindings using macport but it installed only for Ruby. I tried to do it with +python but it ignored that as well. I then tried to compile from source and I get the error configure: error: Xapian library is version 1.2.8 but the bindings are version 0.9.9 – ILikeTurtles May 20 '14 at 21:31
  • `$ port variants xapian-bindings` says it has a `python27` variant. – romainl May 20 '14 at 21:53
  • @romainl I installed the python27 bindings using +python27. It replied with a clean and clear install. Still no dice. – ILikeTurtles May 21 '14 at 12:55

1 Answers1

2
  1. First problem

    The xapian-core package doesn't contain the language bindings necessary for your plugin. You must install the xapian-bindings package for that.

  2. Second problem

    By default, xapian-bindings is installed with ruby bindings only. Since you want it to work with python you must install it with python bindings as well.

    You can see what variants are available for a given port with:

    $ port variant xapian-bindings
    

    and install a specific variant with:

    $ sudo port install xapian-bindings +python27
    
  3. Third problem and final solution

    The bindings are only available through MacPorts' python but your python is the default one provided by Apple. You must set the correct python as default.

    You can see what versions are available on your system with:

    $ port select --list python
    

    and select the right one with:

    $ sudo port select --set python python27
    
romainl
  • 186,200
  • 21
  • 280
  • 313