From fall.mor at outlook.com Mon Jul 23 15:31:40 2018 From: fall.mor at outlook.com (mor fall) Date: Mon, 23 Jul 2018 19:31:40 +0000 Subject: [moin-user] Help on xapian configuration Message-ID: Hello I need help, I v installed and configured my moinmoin wiki on a virtualenv but I am having lots of problems to configure xapian. If anyone here have a tutorial that explains clearly the way to configure xapian on moinmoin it may be very beneficial for me. Regards, Envoy? de mon iPhone From paul at boddie.org.uk Mon Jul 23 16:19:14 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Mon, 23 Jul 2018 22:19:14 +0200 Subject: [moin-user] Help on xapian configuration In-Reply-To: References: Message-ID: <201807232219.14905.paul@boddie.org.uk> On Monday 23. July 2018 21.31.40 mor fall wrote: > Hello > I need help, > I v installed and configured my moinmoin wiki on a virtualenv but I am > having lots of problems to configure xapian. If anyone here have a > tutorial that explains clearly the way to configure xapian on moinmoin it > may be very beneficial for me. Are you having problems installing the Xapian software itself, or are you satisfied that Xapian is properly installed and now find yourself with problems configuring MoinMoin to use it? Last time I had to install or upgrade Xapian, I had to install lots of other things, and it took a lot more work than it previously did. But it should be something like this: wget https://oligarchy.co.uk/xapian/1.4.5/xapian-core-1.4.5.tar.xz cd xapian-core-1.4.5/ ./configure --prefix=/myprefix make make install cd .. wget https://oligarchy.co.uk/xapian/1.4.5/xapian-bindings-1.4.5.tar.xz cd xapian-bindings-1.4.5/ ./configure --with-python --prefix=/myprefix \ PYTHON_LIB=/myprefix/lib/python2.7 PYTHON=/myprefix/bin/python2.7 make make install cd .. Here, /myprefix is the usual "prefix" that indicates where the libraries should be installed. With the bindings, the PYTHON_LIB and PYTHON variables are needed to tell the configure script about the Python installation. This is something of a peculiarity with this package, and the configure script will complain if you don't specify them. The configure script will also complain about things like Sphinx as far as I remember, and it was with Sphinx that I had to track down lots of dependencies (typing, six, docutils, Babel, Jinja2, MarkupSafe, packaging, imagesize, requests, urllib3, certifi, idna, alabaster) which your virtualenv might already have. As far as configuring MoinMoin is concerned, adding this to the class in your wikiconfig.py should be enough: xapian_search = 1 You then need to create an index: moin --config-dir=/wiki --wiki-url=wikisite.tld/ index build --mode=add Here, /wiki is the place where the wikiconfig.py file is found, also containing the data directory. There can be all sorts of problems here: permissions, locks, configuration errors. But let us know where you are now and whether this is helpful. Then we might be able to see you through the process. Paul From fall.mor at outlook.com Tue Jul 24 09:38:38 2018 From: fall.mor at outlook.com (mor fall) Date: Tue, 24 Jul 2018 13:38:38 +0000 Subject: [moin-user] Help on xapian configuration In-Reply-To: <201807232219.14905.paul@boddie.org.uk> References: , <201807232219.14905.paul@boddie.org.uk> Message-ID: Hello, Thank you Paul, i ve configured xapian correctly but when i run the moin command to buld an index i got a lots of error. (python-env) fall at mor:/srv/moin-private/python-env/bin$ moin --config-dir=/srv/moin-private/wiki --wiki-url=localhost/ index build --mode=add 2018-07-24 15:00:43,723 INFO MoinMoin.log:151 using logging configuration read from built-in fallback in MoinMoin.log module 2018-07-24 15:00:43,743 INFO MoinMoin.log:157 Running MoinMoin 1.9.9 release code from /srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin 2018-07-24 15:00:46,885 ERROR MoinMoin.config.multiconfig:53 Your source code / config file is not correctly indented! Traceback (most recent call last): File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/config/multiconfig.py", line 48, in _importConfigModule module = __import__(name, globals(), {}) File "/srv/moin-private/wiki/wikiconfig.py", line 176 xapian_search = 1 ^ IndentationError: unexpected indent Traceback (most recent call last): File "/srv/moin-private/python-env/bin/moin", line 6, in run() File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/moin.py", line 15, in run MoinScript().run(showtime=0) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/__init__.py", line 138, in run self.mainloop() File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/__init__.py", line 266, in mainloop plugin_class(args[2:], self.options).run() # all starts again there File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/__init__.py", line 138, in run self.mainloop() File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/index/build.py", line 80, in mainloop self.init_request() File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/script/__init__.py", line 185, in init_request self.request = ScriptContext(url, self.options.page) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/web/contexts.py", line 439, in __init__ wsgiapp.init(self) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/wsgiapp.py", line 52, in init context.lang = setup_i18n_preauth(context) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/wsgiapp.py", line 241, in setup_i18n_preauth i18n.i18n_init(context) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/i18n/__init__.py", line 73, in i18n_init meta_cache = caching.CacheEntry(request, 'i18n', 'meta', scope='wiki', use_pickle=True) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/caching.py", line 73, in __init__ self.arena_dir = get_arena_dir(request, arena, scope) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/caching.py", line 32, in get_arena_dir return os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/web/contexts.py", line 56, in get res = obj.environ.setdefault(self.name, factory(obj)) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/web/contexts.py", line 128, in cfg cfg = multiconfig.getConfig(self.request.url) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/config/multiconfig.py", line 193, in getConfig cfg = _makeConfig(cfgName) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/config/multiconfig.py", line 123, in _makeConfig module, mtime = _importConfigModule(name) File "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/config/multiconfig.py", line 62, in _importConfigModule raise error.ConfigurationError(msg) MoinMoin.error.ConfigurationError: IndentationError: unexpected indent (wikiconfig.py, line 176) The configuration files are Python modules. Therefore, whitespace is important. Make sure that you use only spaces, no tabs are allowed here! You have to use four spaces at the beginning of the line mostly. regards, ________________________________ De : moin-user de la part de Paul Boddie Envoy? : lundi 23 juillet 2018 22:19 ? : moin-user at python.org Objet : Re: [moin-user] Help on xapian configuration On Monday 23. July 2018 21.31.40 mor fall wrote: > Hello > I need help, > I v installed and configured my moinmoin wiki on a virtualenv but I am > having lots of problems to configure xapian. If anyone here have a > tutorial that explains clearly the way to configure xapian on moinmoin it > may be very beneficial for me. Are you having problems installing the Xapian software itself, or are you satisfied that Xapian is properly installed and now find yourself with problems configuring MoinMoin to use it? Last time I had to install or upgrade Xapian, I had to install lots of other things, and it took a lot more work than it previously did. But it should be something like this: wget https://oligarchy.co.uk/xapian/1.4.5/xapian-core-1.4.5.tar.xz cd xapian-core-1.4.5/ ./configure --prefix=/myprefix make make install cd .. wget https://oligarchy.co.uk/xapian/1.4.5/xapian-bindings-1.4.5.tar.xz cd xapian-bindings-1.4.5/ ./configure --with-python --prefix=/myprefix \ PYTHON_LIB=/myprefix/lib/python2.7 PYTHON=/myprefix/bin/python2.7 make make install cd .. Here, /myprefix is the usual "prefix" that indicates where the libraries should be installed. With the bindings, the PYTHON_LIB and PYTHON variables are needed to tell the configure script about the Python installation. This is something of a peculiarity with this package, and the configure script will complain if you don't specify them. The configure script will also complain about things like Sphinx as far as I remember, and it was with Sphinx that I had to track down lots of dependencies (typing, six, docutils, Babel, Jinja2, MarkupSafe, packaging, imagesize, requests, urllib3, certifi, idna, alabaster) which your virtualenv might already have. As far as configuring MoinMoin is concerned, adding this to the class in your wikiconfig.py should be enough: xapian_search = 1 You then need to create an index: moin --config-dir=/wiki --wiki-url=wikisite.tld/ index build --mode=add Here, /wiki is the place where the wikiconfig.py file is found, also containing the data directory. There can be all sorts of problems here: permissions, locks, configuration errors. But let us know where you are now and whether this is helpful. Then we might be able to see you through the process. Paul _______________________________________________ moin-user mailing list moin-user at python.org https://mail.python.org/mailman/listinfo/moin-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Tue Jul 24 10:15:02 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Tue, 24 Jul 2018 16:15:02 +0200 Subject: [moin-user] Help on xapian configuration In-Reply-To: References: <201807232219.14905.paul@boddie.org.uk> Message-ID: <201807241615.03470.paul@boddie.org.uk> On Tuesday 24. July 2018 15.38.38 mor fall wrote: > Hello, > Thank you Paul, > > i ve configured xapian correctly but when i run the moin command to buld > an index i got a lots of error. I'll extract the parts you need to look at more closely: > 2018-07-24 15:00:46,885 ERROR MoinMoin.config.multiconfig:53 Your source > code / config file is not correctly indented! Traceback (most recent call > last): > File > "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/c > onfig/multiconfig.py", line 48, in _importConfigModule module = > __import__(name, globals(), {}) > File "/srv/moin-private/wiki/wikiconfig.py", line 176 > xapian_search = 1 > ^ > IndentationError: unexpected indent [...] > MoinMoin.error.ConfigurationError: IndentationError: unexpected indent > (wikiconfig.py, line 176) > > The configuration files are Python modules. Therefore, whitespace is > important. Make sure that you use only spaces, no tabs are allowed here! > You have to use four spaces at the beginning of the line mostly. So what this means is that you have to be careful how you edit the file. In the wikiconfig.py file, you will see the following close to the top of the file: class Config(DefaultConfig): Below this, there are lots of different settings that appear indented, normally using four spaces at the start of each line, followed by the actual text. For example: sitename = 'Documentation Wiki' ^^^^ These will be the spaces! You just need to make sure that below these settings, you add the new setting with four spaces and then the actual text: xapian_search = 1 ^^^^ These will be the spaces! If you use a tab character and your editor doesn't turn it into spaces, you will get an error. Maybe the easiest approach that might still work is to put the new setting right below the sitename setting, making sure it lines up using spaces. If you and/or your editor have changed the file to use tabs instead, which isn't really recommended, you should also use tabs for the new setting. But I'm assuming that your wikiconfig.py file is just a modified version of the standard one. Paul From fall.mor at outlook.com Tue Jul 24 11:22:13 2018 From: fall.mor at outlook.com (mor fall) Date: Tue, 24 Jul 2018 15:22:13 +0000 Subject: [moin-user] Help on xapian configuration In-Reply-To: <201807241615.03470.paul@boddie.org.uk> References: <201807232219.14905.paul@boddie.org.uk> , <201807241615.03470.paul@boddie.org.uk> Message-ID: I have just added some intended lines in the standard wikiconfig.py (ACL). I think that the errors come from the wiki directory permission. Make sure the directory and the subdirectory "pages" are owned by the web server and are readable, writable and executable by the web server user and group. sorry for my english i am not a native english speaker regards, ________________________________ De : Paul Boddie Envoy? : mardi 24 juillet 2018 16:15 ? : moin-user at python.org Cc : mor fall Objet : Re: [moin-user] Help on xapian configuration On Tuesday 24. July 2018 15.38.38 mor fall wrote: > Hello, > Thank you Paul, > > i ve configured xapian correctly but when i run the moin command to buld > an index i got a lots of error. I'll extract the parts you need to look at more closely: > 2018-07-24 15:00:46,885 ERROR MoinMoin.config.multiconfig:53 Your source > code / config file is not correctly indented! Traceback (most recent call > last): > File > "/srv/moin-private/python-env/local/lib/python2.7/site-packages/MoinMoin/c > onfig/multiconfig.py", line 48, in _importConfigModule module = > __import__(name, globals(), {}) > File "/srv/moin-private/wiki/wikiconfig.py", line 176 > xapian_search = 1 > ^ > IndentationError: unexpected indent [...] > MoinMoin.error.ConfigurationError: IndentationError: unexpected indent > (wikiconfig.py, line 176) > > The configuration files are Python modules. Therefore, whitespace is > important. Make sure that you use only spaces, no tabs are allowed here! > You have to use four spaces at the beginning of the line mostly. So what this means is that you have to be careful how you edit the file. In the wikiconfig.py file, you will see the following close to the top of the file: class Config(DefaultConfig): Below this, there are lots of different settings that appear indented, normally using four spaces at the start of each line, followed by the actual text. For example: sitename = 'Documentation Wiki' ^^^^ These will be the spaces! You just need to make sure that below these settings, you add the new setting with four spaces and then the actual text: xapian_search = 1 ^^^^ These will be the spaces! If you use a tab character and your editor doesn't turn it into spaces, you will get an error. Maybe the easiest approach that might still work is to put the new setting right below the sitename setting, making sure it lines up using spaces. If you and/or your editor have changed the file to use tabs instead, which isn't really recommended, you should also use tabs for the new setting. But I'm assuming that your wikiconfig.py file is just a modified version of the standard one. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Tue Jul 24 12:10:12 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Tue, 24 Jul 2018 18:10:12 +0200 Subject: [moin-user] Help on xapian configuration In-Reply-To: References: <201807241615.03470.paul@boddie.org.uk> Message-ID: <201807241810.12450.paul@boddie.org.uk> On Tuesday 24. July 2018 17.22.13 mor fall wrote: > I have just added some intended lines in the standard wikiconfig.py (ACL). > > I think that the errors come from the wiki directory permission. IndentationError is definitely a problem with the format of wikiconfig.py, though, so it is worth investigating that. > Make sure the directory and the subdirectory "pages" are owned by the web > server and are readable, writable and executable by the web server user > and group. Yes, this can also be a problem. I sometimes run the moin program using sudo like this: sudo -u www-data moin ... The username (www-data) depends on what kind of system you are using, but you can easily find this out. (I have sometimes used ACLs instead of different ownership, but it can be awkward to configure this correctly.) > sorry for my english i am not a native english speaker No problem. When I need to express myself in other languages, I probably don't do it as well as I could do, but you are making yourself clear enough. :-) Paul From fall.mor at outlook.com Wed Jul 25 04:46:02 2018 From: fall.mor at outlook.com (mor fall) Date: Wed, 25 Jul 2018 08:46:02 +0000 Subject: [moin-user] Help on xapian configuration In-Reply-To: <201807241810.12450.paul@boddie.org.uk> References: <201807241615.03470.paul@boddie.org.uk> , <201807241810.12450.paul@boddie.org.uk> Message-ID: hello, Before continuing my configuration, i would like to know if Xapian can search in the attached files on the moinmoin wiki like pdf pages, word ...? regards ________________________________ De : Paul Boddie Envoy? : mardi 24 juillet 2018 18:10 ? : moin-user at python.org Cc : mor fall Objet : Re: [moin-user] Help on xapian configuration On Tuesday 24. July 2018 17.22.13 mor fall wrote: > I have just added some intended lines in the standard wikiconfig.py (ACL). > > I think that the errors come from the wiki directory permission. IndentationError is definitely a problem with the format of wikiconfig.py, though, so it is worth investigating that. > Make sure the directory and the subdirectory "pages" are owned by the web > server and are readable, writable and executable by the web server user > and group. Yes, this can also be a problem. I sometimes run the moin program using sudo like this: sudo -u www-data moin ... The username (www-data) depends on what kind of system you are using, but you can easily find this out. (I have sometimes used ACLs instead of different ownership, but it can be awkward to configure this correctly.) > sorry for my english i am not a native english speaker No problem. When I need to express myself in other languages, I probably don't do it as well as I could do, but you are making yourself clear enough. :-) Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Wed Jul 25 07:44:44 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Wed, 25 Jul 2018 13:44:44 +0200 Subject: [moin-user] Help on xapian configuration In-Reply-To: References: <201807241810.12450.paul@boddie.org.uk> Message-ID: <201807251344.45157.paul@boddie.org.uk> On Wednesday 25. July 2018 10.46.02 mor fall wrote: > hello, > > Before continuing my configuration, i would like to know if Xapian can > search in the attached files on the moinmoin wiki like pdf pages, word > ...? The documentation covers this question: https://moinmo.in/HelpOnXapian I don't have any personal experience with this, but maybe other people do. Paul From paul at boddie.org.uk Wed Jul 25 12:15:13 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Wed, 25 Jul 2018 18:15:13 +0200 Subject: [moin-user] [Moin-user] Creating a static copy of a MoinMoin site Message-ID: <201807251815.13629.paul@boddie.org.uk> On Tuesday 12. April 2016 17.03.07 Paul Waring wrote: > On Tue, Apr 12, 2016 at 02:21:16PM +0000, Roger Haase wrote: > > It has been a few years since I have used this, but > > try: HelpOnMoinCommand/ExportDump - MoinMoin > > > > HelpOnMoinCommand/ExportDump - MoinMoin > > I've tried that but there are two big problems with the export dump: > > 1. It adds a .html extension to all pages, meaning that all external > links (i.e. those linking to the wiki from another site) break. > > 2. It changes a forward slash in URLs to (2f), e.g. About/Contact > because About(2f)Contact.html (again breaking URLs) Sorry to dredge this thread up again from over two years ago, but after having the need to look into this kind of thing myself, I will admit that the output is not particularly easy to work with. Hopefully, some more remarks might be helpful to others in a similar situation. My original reply to this indicated that it might be possible to configure the software to do the right thing, but in the situation where one just needs to get the content exported, it is not so easy to figure this out. Indeed, I ended up making changes to the export dump program just to get things done: MoinMoin/script/export/dump.py First of all, the .html extension can be removed by setting HTML_SUFFIX to "". I think that should deal with this particular problem decisively. However, we are then left with the page name rewriting that also affects the links in documents. Changing the fundamental mechanism for encoding page names can have the undesirable result of creating phantom page directories in the wiki itself. I also strongly dislike the way the export dump program "monkeypatches" wikiutil: wikiutil.quoteWikinameURL = lambda pagename, qfn=wikiutil.quoteWikinameFS: (qfn(pagename) + HTML_SUFFIX) I removed this, in fact, because it seems to me that there is some conflation between page names and link targets, and indeed the source states the following assumption: # we have the same name in URL and FS So the export dump program treats the files containing the page data and the names used in links as one and the same thing. This obviously exposes ".html" all over the place (until we fix that, as noted above) and inserts the "(xx)" sequences, thus breaking all external links to the content. (I suppose that Web server rewrite rules might be able to help with this, but such functionality is generally horrid as well as being rather poorly documented.) The slash-escaping is unhelpful but perhaps necessary in the sense that Apache, at least, always treats slashes as path separators, and there is no apparently easy way to rewrite them: the interpretation happens too early in the request processing. I spent ages looking at this because the documentation doesn't obviously mention it. There are also issues with providing appropriate URLs for the static resources and generating the logo. I also don't particularly see the need to generate all the underlay pages, given that most of them are help for Moin or other things that don't contribute to a static site, or indeed the navigation bar. In the end, despite wanting only static files to deploy, I had to accept filesystem-encoded names, and so I wrote a script to rewrite URLs from their proper form to the filesystem encoding, loading and sending the content within my script. The solution becomes more like a simple script backed by static resources than a proper static site. Here is an example of the result: http://projects.boddie.org.uk/ (I reserve the right to migrate this to content not produced using export dump, obviously, but since the source content is in Moin format, I intend the output to be broadly similar no matter what I end up using.) Now for some background and another, related topic... What made me investigate this was some worrying problems with cache files being created within my locked-down wikis, plus general log file growth. Although I arrived at a solution using export dump, it feels like a nasty hack. Consequently, I have been working on tools to parse Moin content and to produce static output. At some point, I will start using these new tools actively for sites where I don't need the through-the-Web editing facilities of Moin. I also intend to release the code and maybe build on it for other projects. Providing people with acceptable migration paths and independent tools is the right thing to do, I feel. Anyway, I hope this was helpful, and apologies if this is an unwelcome return to a topic no longer of interest. Paul From fall.mor at outlook.com Fri Jul 27 08:40:48 2018 From: fall.mor at outlook.com (mor fall) Date: Fri, 27 Jul 2018 12:40:48 +0000 Subject: [moin-user] xapian on moinmoin Message-ID: Hello evrybody I m trying to configure xapian on my wiki but whenever i execute the the command to build an index i got this error. If someone have a solution to resolve it. regards, sudo /srv/moin-private/python-env/bin/moin --config-dir=/srv/moin-private/wiki --wiki-url=localhost/ index build --mode=add 2018-07-26 18:13:52,230 INFO MoinMoin.log:151 using logging configuration read from built-in fallback in MoinMoin.log module 2018-07-26 18:13:52,232 INFO MoinMoin.log:157 Running MoinMoin 1.9.9 release code from /srv/moin-private/moin-1.9.9/MoinMoin 2018-07-26 18:13:53,631 ERROR MoinMoin.config.multiconfig:366 xapian_search was auto-disabled because python-xapian is not installed [No module named xapian]. 2018-07-26 18:13:53,713 INFO MoinMoin.config.multiconfig:127 using wiki config: /srv/moin-private/wiki/wikiconfig.pyc -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Fri Jul 27 15:47:14 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Fri, 27 Jul 2018 21:47:14 +0200 Subject: [moin-user] xapian on moinmoin In-Reply-To: References: Message-ID: <201807272147.14829.paul@boddie.org.uk> On Friday 27. July 2018 14.40.48 mor fall wrote: > Hello evrybody > > I m trying to configure xapian on my wiki but whenever i execute the the > command to build an index i got this error. If someone have a solution to > resolve it. > > regards, > > sudo /srv/moin-private/python-env/bin/moin > --config-dir=/srv/moin-private/wiki --wiki-url=localhost/ index build > --mode=add 2018-07-26 18:13:52,230 INFO MoinMoin.log:151 using logging > configuration read from built-in fallback in MoinMoin.log module > 2018-07-26 18:13:52,232 INFO MoinMoin.log:157 Running MoinMoin 1.9.9 > release code from /srv/moin-private/moin-1.9.9/MoinMoin 2018-07-26 > 18:13:53,631 ERROR MoinMoin.config.multiconfig:366 xapian_search was > auto-disabled because python-xapian is not installed [No module named > xapian]. 2018-07-26 18:13:53,713 INFO MoinMoin.config.multiconfig:127 > using wiki config: /srv/moin-private/wiki/wikiconfig.pyc This indicates that the moin script cannot load the xapian package, which is provided by the xapian-bindings code. You can either try and configure the environment using PYTHONPATH or just change the moin script to specify the location of the xapian package. It is probably easier to do the second of these things. So, in /srv/moin-private/python-env/bin/moin you can follow the advice and edit the code as follows: #Fix and uncomment those 2 lines if your moin command doesn't find... import sys sys.path.insert(0, '/srv/moin-private/python-env/lib/python2.7/site-packages') Here, I made a guess at where you have installed the xapian package, but you will have specified this using PYTHON_LIB when configuring the xapian-bindings code. For the above guess, you would have needed to have given PYTHON_LIB as... /srv/moin-private/python-env/lib/python2.7 So, in the moin script you would add whatever PYTHON_LIB was with an extra "site-packages" component at the end. I hope this helps. Paul P.S. It might be best to run sudo using the -u option to specify the user. Otherwise, apart from the risks with running as root, the index files will end up with root ownership (most likely) and won't be readable by the wiki. From fall.mor at outlook.com Sun Jul 29 09:31:28 2018 From: fall.mor at outlook.com (mor fall) Date: Sun, 29 Jul 2018 13:31:28 +0000 Subject: [moin-user] xapian on moinmoin In-Reply-To: <201807272147.14829.paul@boddie.org.uk> References: , <201807272147.14829.paul@boddie.org.uk> Message-ID: hello Paul Have you an example on how to insert PYTHON_LIB on moin command. I have never learnt python, i try to check on the internet but i didn't understand how to insert PYTHON_LIB thanks ________________________________ De : Paul Boddie Envoy? : vendredi 27 juillet 2018 21:47 ? : moin-user at python.org Cc : mor fall Objet : Re: [moin-user] xapian on moinmoin On Friday 27. July 2018 14.40.48 mor fall wrote: > Hello evrybody > > I m trying to configure xapian on my wiki but whenever i execute the the > command to build an index i got this error. If someone have a solution to > resolve it. > > regards, > > sudo /srv/moin-private/python-env/bin/moin > --config-dir=/srv/moin-private/wiki --wiki-url=localhost/ index build > --mode=add 2018-07-26 18:13:52,230 INFO MoinMoin.log:151 using logging > configuration read from built-in fallback in MoinMoin.log module > 2018-07-26 18:13:52,232 INFO MoinMoin.log:157 Running MoinMoin 1.9.9 > release code from /srv/moin-private/moin-1.9.9/MoinMoin 2018-07-26 > 18:13:53,631 ERROR MoinMoin.config.multiconfig:366 xapian_search was > auto-disabled because python-xapian is not installed [No module named > xapian]. 2018-07-26 18:13:53,713 INFO MoinMoin.config.multiconfig:127 > using wiki config: /srv/moin-private/wiki/wikiconfig.pyc This indicates that the moin script cannot load the xapian package, which is provided by the xapian-bindings code. You can either try and configure the environment using PYTHONPATH or just change the moin script to specify the location of the xapian package. It is probably easier to do the second of these things. So, in /srv/moin-private/python-env/bin/moin you can follow the advice and edit the code as follows: #Fix and uncomment those 2 lines if your moin command doesn't find... import sys sys.path.insert(0, '/srv/moin-private/python-env/lib/python2.7/site-packages') Here, I made a guess at where you have installed the xapian package, but you will have specified this using PYTHON_LIB when configuring the xapian-bindings code. For the above guess, you would have needed to have given PYTHON_LIB as... /srv/moin-private/python-env/lib/python2.7 So, in the moin script you would add whatever PYTHON_LIB was with an extra "site-packages" component at the end. I hope this helps. Paul P.S. It might be best to run sudo using the -u option to specify the user. Otherwise, apart from the risks with running as root, the index files will end up with root ownership (most likely) and won't be readable by the wiki. -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Sun Jul 29 10:24:32 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Sun, 29 Jul 2018 16:24:32 +0200 Subject: [moin-user] xapian on moinmoin In-Reply-To: References: <201807272147.14829.paul@boddie.org.uk> Message-ID: <201807291624.32907.paul@boddie.org.uk> On Sunday 29. July 2018 15.31.28 mor fall wrote: > hello Paul > Have you an example on how to insert PYTHON_LIB on moin command. > I have never learnt python, i try to check on the internet but i didn't > understand how to insert PYTHON_LIB From my first reply, referring to what you might specify when installing xapian-bindings... ./configure --with-python --prefix=/myprefix \ PYTHON_LIB=/myprefix/lib/python2.7 PYTHON=/myprefix/bin/python2.7 So, when you configured xapian-bindings, you will have used the PYTHON_LIB variable on the command line like in the example above. This variable is specific to xapian-bindings and is not a standard variable for use with Python or Moin. It is just something that the Xapian developers decided that you have to specify. But it is the value of that variable which is of interest. You need to use that value to change the moin script so that the sys.path refers to where the xapian-bindings are installed for Python. Again, this is what I wrote about that... > So, in /srv/moin-private/python-env/bin/moin you can follow the advice and > edit the code as follows: > > #Fix and uncomment those 2 lines if your moin command doesn't find... > import sys > sys.path.insert(0, > '/srv/moin-private/python-env/lib/python2.7/site-packages') > > Here, I made a guess at where you have installed the xapian package, but > you will have specified this using PYTHON_LIB when configuring the > xapian-bindings code. And what I mention in the above is the process I mention at the top of this mail. So what you need to do is... 1. Review the way you configured xapian-bindings and note the value of the PYTHON_LIB variable. 2. Take the value of the PYTHON_LIB variable and see whether the directory it specifies contains Xapian-related software. 3. Adjust the value of PYTHON_LIB to work with Python. This may mean adding "site-packages" to the end. 4. Change the moin script, putting the value in a sys.path.insert call. I hope this is clearer now. Paul From fall.mor at outlook.com Mon Jul 30 05:35:08 2018 From: fall.mor at outlook.com (mor fall) Date: Mon, 30 Jul 2018 09:35:08 +0000 Subject: [moin-user] xapian on moinmoin In-Reply-To: <201807291624.32907.paul@boddie.org.uk> References: <201807272147.14829.paul@boddie.org.uk> , <201807291624.32907.paul@boddie.org.uk> Message-ID: I try to reconfigure xapian but it complains about python-sphinx "Configure: error: couldn't import sphinx module and call sphinx.main() i have also install python2.7-sphinx but nothing change. Regards, ________________________________ De : Paul Boddie Envoy? : dimanche 29 juillet 2018 16:24 ? : moin-user at python.org Cc : mor fall Objet : Re: [moin-user] xapian on moinmoin On Sunday 29. July 2018 15.31.28 mor fall wrote: > hello Paul > Have you an example on how to insert PYTHON_LIB on moin command. > I have never learnt python, i try to check on the internet but i didn't > understand how to insert PYTHON_LIB >From my first reply, referring to what you might specify when installing xapian-bindings... ./configure --with-python --prefix=/myprefix \ PYTHON_LIB=/myprefix/lib/python2.7 PYTHON=/myprefix/bin/python2.7 So, when you configured xapian-bindings, you will have used the PYTHON_LIB variable on the command line like in the example above. This variable is specific to xapian-bindings and is not a standard variable for use with Python or Moin. It is just something that the Xapian developers decided that you have to specify. But it is the value of that variable which is of interest. You need to use that value to change the moin script so that the sys.path refers to where the xapian-bindings are installed for Python. Again, this is what I wrote about that... > So, in /srv/moin-private/python-env/bin/moin you can follow the advice and > edit the code as follows: > > #Fix and uncomment those 2 lines if your moin command doesn't find... > import sys > sys.path.insert(0, > '/srv/moin-private/python-env/lib/python2.7/site-packages') > > Here, I made a guess at where you have installed the xapian package, but > you will have specified this using PYTHON_LIB when configuring the > xapian-bindings code. And what I mention in the above is the process I mention at the top of this mail. So what you need to do is... 1. Review the way you configured xapian-bindings and note the value of the PYTHON_LIB variable. 2. Take the value of the PYTHON_LIB variable and see whether the directory it specifies contains Xapian-related software. 3. Adjust the value of PYTHON_LIB to work with Python. This may mean adding "site-packages" to the end. 4. Change the moin script, putting the value in a sys.path.insert call. I hope this is clearer now. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Mon Jul 30 07:12:22 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Mon, 30 Jul 2018 13:12:22 +0200 Subject: [moin-user] xapian on moinmoin In-Reply-To: References: <201807291624.32907.paul@boddie.org.uk> Message-ID: <201807301312.24030.paul@boddie.org.uk> On Monday 30. July 2018 11.35.08 mor fall wrote: > I try to reconfigure xapian > but it complains about python-sphinx > "Configure: error: couldn't import sphinx module and call sphinx.main() > i have also install python2.7-sphinx but nothing change. If you already managed to install Xapian and the bindings, then maybe it is worth finding where the file _xapian.so has been installed. It should be inside a directory called xapian, and that directory is probably inside a site-packages directory: .../site-packages/xapian/_xapian.so If you succeed in finding this, you could then take the .../site-packages part from the location and use that to set sys.path in the moin script. If you didn't manage to install Xapian earlier, you will need to specify to the configure scripts the details of your Python installation. It might help to provide a bit more information about the following so that we can help you a bit more: * The exact command when running configure * The error you get when it fails * Where things like your Python libraries are on your system * How you installed Python libraries and other things Without this information, other people have to guess, and this is not very helpful for you or anyone else. But first check to see if _xapian.so was installed somewhere. Paul From fall.mor at outlook.com Tue Jul 31 11:20:15 2018 From: fall.mor at outlook.com (mor fall) Date: Tue, 31 Jul 2018 15:20:15 +0000 Subject: [moin-user] xapian on moinmoin In-Reply-To: <201807301312.24030.paul@boddie.org.uk> References: <201807291624.32907.paul@boddie.org.uk> , <201807301312.24030.paul@boddie.org.uk> Message-ID: hello, the _xapian.so is installed in the /usr/lib/python2.7/dist-packages/xapian. It seems very weird to me because when i have installed xapian core and xapian bindings i use the prefix to force the installation in the virtualenv like this: cd /srv/moin-private/xapian-core-1.4.7 ./confifgure --prefix=/srv/moin-private/virtualenv make make install ________________________________ De : Paul Boddie Envoy? : lundi 30 juillet 2018 13:12 ? : moin-user at python.org Cc : mor fall Objet : Re: [moin-user] xapian on moinmoin On Monday 30. July 2018 11.35.08 mor fall wrote: > I try to reconfigure xapian > but it complains about python-sphinx > "Configure: error: couldn't import sphinx module and call sphinx.main() > i have also install python2.7-sphinx but nothing change. If you already managed to install Xapian and the bindings, then maybe it is worth finding where the file _xapian.so has been installed. It should be inside a directory called xapian, and that directory is probably inside a site-packages directory: .../site-packages/xapian/_xapian.so If you succeed in finding this, you could then take the .../site-packages part from the location and use that to set sys.path in the moin script. If you didn't manage to install Xapian earlier, you will need to specify to the configure scripts the details of your Python installation. It might help to provide a bit more information about the following so that we can help you a bit more: * The exact command when running configure * The error you get when it fails * Where things like your Python libraries are on your system * How you installed Python libraries and other things Without this information, other people have to guess, and this is not very helpful for you or anyone else. But first check to see if _xapian.so was installed somewhere. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Tue Jul 31 12:18:46 2018 From: paul at boddie.org.uk (Paul Boddie) Date: Tue, 31 Jul 2018 18:18:46 +0200 Subject: [moin-user] xapian on moinmoin In-Reply-To: References: <201807301312.24030.paul@boddie.org.uk> Message-ID: <201807311818.46415.paul@boddie.org.uk> On Tuesday 31. July 2018 17.20.15 mor fall wrote: > hello, > the _xapian.so is installed in the > /usr/lib/python2.7/dist-packages/xapian. So this probably means that you have some operating system packages installed. Do you then really need to install these things again somewhere else? It may mean that you need to download and install lots of dependencies. > It seems very weird to me because when i have installed xapian core and > xapian bindings i use the prefix to force the installation in the > virtualenv like this: cd /srv/moin-private/xapian-core-1.4.7 > ./confifgure --prefix=/srv/moin-private/virtualenv > make > make install That would install xapian-core, but what about xapian-bindings? And what is the motivation to use virtualenv? I don't tend to use things like virtualenv because they usually cause surprises and don't really solve some of the more important problems, anyway, like dependencies on things that are not specifically made for Python. I can imagine that virtualenv might help with installing Sphinx and other Python packages, though. So you would need to tell me if virtualenv stops Python from seeing the distribution packages by changing the PYTHONPATH/sys.path, which may be one of your problems. If it does, then I could understand you needing to install things inside the virtual environment, but it is making unnecessary work for you. You could just install Moin inside a special "prefix" instead. That's what I tend to do. Something like this: python setup.py install --install-lib='$PREFIX/lib/python2.7/site-packages' \ --install-data='$PREFIX' \ --install-scripts='$PREFIX/bin' Here, $PREFIX needs replacing with the actual location, of course. And hopefully, Python would still find the installed packages for Xapian. Paul