Git Product home page Git Product logo

Comments (14)

 avatar commented on May 10, 2024

Hi,

Please check that your webui.py file has code like the following near the top:

try:
    from recoll import recoll
    from recoll import rclextract
    hasrclextract = True
except:
    import recoll
    hasrclextract = False

This is to confirm that your copy is indeed updated for the 1.19 Recoll Python package.

If this is ok, then the next possibility is that there is a mixup of both versions of the Recoll Python package installed. There should be a "recoll" directory where your local python packages are installed (e.g.: /usr/lib/python2.7/dist-packages, but this could be under /usr/local and/or under site-packages). Check that there is no recoll.so file at the same level as the recoll directory (there should be a recoll.so inside the recoll directory). If there is a recoll.so at the same level as the directory, just delete it.

I sure regret having chosen the same name (recoll) for the package as was previously used for the module, it's causing no end of trouble...

from recoll-webui.

wonx avatar wonx commented on May 10, 2024

Yes, the copy is updated; the code is exactly as you wrote it.

I only found one copy of recoll.so, inside the "recoll" directory in "/usr/lib/python2.6/dist-packages.

I tried now to completely uninstall recoll and delete the previous database and reinstall it again, with no luck. I still get the same error. The operating system of the computer where it is running is Debian 6. However, I tried your script in my laptop computer (Linux mint 14) and it works, so there must be something wrong with my server. Maybe the python version is too old?

from recoll-webui.

 avatar commented on May 10, 2024

I have no reason to believe that the module does not work with Python 2.6, but I'm not too sure I've ever tested either.

This has to be an issue with the Recoll Python module, no need to reinstall anything else or rebuild the index.

Could you please try the following:

  • Check that there is only one Python version on the server.

  • Start python on the command line and try the following command:

    from recoll import recoll

  • If it works, you can try:
    recoll.connect()

from recoll-webui.

wonx avatar wonx commented on May 10, 2024
user@box-media:~$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from recoll import recoll
>>> recoll.connect()
<recoll.Db object at 0xb73ef080>
>>> 

What else?

from recoll-webui.

 avatar commented on May 10, 2024

At this point we know that things are working normally when you load the recoll module from the command line python, but not from the recoll-webui script.

Does it make any difference if you start Python with "/usr/bin/env python" instead of the above ? This is how the script starts Python.

Where did you start the webui script from ?

I'm just poking in the dark, really, I have no real idea what may be happening here, except that it seems that the script is somehow loading the wrong thing as a recoll module... So this should have something to do with the Python module search path (sys.path), or the current directory when the script is started.

from recoll-webui.

wonx avatar wonx commented on May 10, 2024

It doesn't make any difference if I start python with "/usr/bin/env python" and run the same commands.

I'm starting the script from my home directory:

user@box-media:~$ cd
user@box-media:~$ cd recoll-webui-master/
user@box-media:~/recoll-webui-master$ ./webui-standalone.py
Bottle server starting up (using WSGIRefServer())...
Listening on http://box-media:3888/
Hit Ctrl-C to quit.

From this terminal, I can see the search queries. I usually enter the URL from another computer in the same network, but now I also tried it from the local server, and I get the same error message.

from recoll-webui.

 avatar commented on May 10, 2024

Ok. I'm out of ideas at this point.

I think I'll try to install debian 6 in a virtual machine and see if I can reproduce the problem.

The standard Debian recoll packages are not up to date. How did you install 1.19.5 (I want to do it like you) ?

from recoll-webui.

wonx avatar wonx commented on May 10, 2024

Don't worry. I should upgrade my server to a clean version of debian 7, because I've been messing up with my current installation so much that it isn't strange that sometimes things stop working unexpectedly.

I installed the last version of recoll using repositories. Add the following to /etc/apt/sources.list

#Recoll
deb http://ppa.launchpad.net/recoll-backports/recoll-1.15-on/ubuntu lucid main
deb-src http://ppa.launchpad.net/recoll-backports/recoll-1.15-on/ubuntu lucid main

Also, I run my X programs inside a VNC server. And the whole server is virtualised inside a openVZ container.

from recoll-webui.

wonx avatar wonx commented on May 10, 2024

By the way. I quickly installed a debian 7 server, with recoll 1.19.5 the way I just told you, and then I try to run your script (this time from the /root directory), I get:

root@box-media7:~/recoll-webui-master# ./webui-standalone.py
Traceback (most recent call last):
  File "./webui-standalone.py", line 3, in <module>
    import webui
  File "/root/recoll-webui-master/webui.py", line 13, in <module>
    import recoll
ImportError: No module named recoll
root@box-media7:~/recoll-webui-master# 

Also:

root@box-media7:~# python
Python 2.7.3 (default, Jan  2 2013, 16:53:07) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from recoll import recoll
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named recoll
>>> 

from recoll-webui.

 avatar commented on May 10, 2024

Are you still using the lucid packages ? Because they probably install for python 2.6 and you are now running python 2.7

Here is what I did:

  • Installed Debian Wheezy (7.1)
  • Installed the regular recoll and python-recoll packages (to easily get the dependancies)
  • Uninstalled recoll and python-recoll
  • Added the PPA to the apt sources, replacing lucid with qantal (precise does not work because the requested libc is too new)
  • apt-get-install recoll (this also installs the python module because it's integral to the PPA package)
  • Unpacked recoll-webui-master
  • Ran the standalone server

-> Worked

I noticed by the way that recoll-webui needs the topdirs variable to be explicitely defined in ~/.recoll/recoll.conf, which is not necessarily the case for a default recoll install (it defaults to ~). Anyway, topdirs = ~ did it.

I am not sure that it's really wise to use the PPA Ubuntu packages on Debian. I wonder if you might not be better off just compiling recoll from source (which is really not hard). This business of choosing the Ubuntu release by trial and error does not appear too sound to me :)

from recoll-webui.

wonx avatar wonx commented on May 10, 2024

Under debian wheezy (7.1), and using the oneiric (not quantal) version of the PPA, i've been able to install a recoll version (1.19.3) that worked with your script. Also, I think that python-recoll isn't needed in the last version of recoll. (not sure)

I know, using an Ubuntu ppa in Debian is not wise at all. It just was quick and dirty way of trying recoll in my server. Now that I see that it's possible to make it work, I'll find a more appropiate way of installing it.

Thank you for your patience, you are doing a great job!

from recoll-webui.

 avatar commented on May 10, 2024

using the oneiric (not quantal)

Oops, sorry, I seem to have trouble with my alphabet. And the worse thing is that I did try qantal before going back to oneiric which is the one with which it did work, and then I do it again by writing qantal !

from recoll-webui.

dsheyp avatar dsheyp commented on May 10, 2024

Hello.

I have the exact same problem as described by wonx.
Everything works as expected with webui-standalone.py but with webui-wsgi.py there is exactly the same error as described by wonx.

my python version is 2.7
i downloaded and installed the packages directly from https://github.com/koniu/recoll-webui
i checked everything that you wrote above.

do you have any idea what could be wrong?

many thanks in advance

from recoll-webui.

dsheyp avatar dsheyp commented on May 10, 2024

Hello

Ok. I found a solution.
As you set a user and group for the WSGIDaemonProcess you have to make sure, this user has access to the index-files and also the config in ~/.recoll/

thanks for this great software

from recoll-webui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.