web2py book error ImportError: Requires pygments module, but it is not available

18 views
Skip to first unread message

mostwanted

unread,
Jul 20, 2020, 4:53:42 AM7/20/20
to web2py-users
I have downloaded the web2py book app but when I try to open from my laptop i get this error flashing:
web2py book error ImportError: Requires pygments module, but it is not available!

I am using web2py  Version 2.20.4, how do I resolve it?

Regards;

Mostwanted

Nico Zanferrari

unread,
Jul 20, 2020, 5:04:45 AM7/20/20
to web...@googlegroups.com
Hi,

you just need to:

pip install pygments

on your system, but beware to use the right pip program corresponding to the python version you're using. In this way web2py's book application will be able to use it ;-)

Nico


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/2343e380-7919-4882-b044-2db4a53c8c74o%40googlegroups.com.

mostwanted

unread,
Jul 20, 2020, 7:05:43 AM7/20/20
to web2py-users
Thank you Nico

On Monday, July 20, 2020 at 11:04:45 AM UTC+2, Nico Zanferrari wrote:
Hi,

you just need to:

pip install pygments

on your system, but beware to use the right pip program corresponding to the python version you're using. In this way web2py's book application will be able to use it ;-)

Nico


Il giorno lun 20 lug 2020 alle ore 10:53 mostwanted <godir...@gmail.com> ha scritto:
I have downloaded the web2py book app but when I try to open from my laptop i get this error flashing:
web2py book error ImportError: Requires pygments module, but it is not available!

I am using web2py  Version 2.20.4, how do I resolve it?

Regards;

Mostwanted

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

mostwanted

unread,
Jul 20, 2020, 8:59:00 AM7/20/20
to web...@googlegroups.com
I feel like I'm about to ask a very ironic question but I need to know so here goes; So my web2py is running python Python 2.7.16 but my system is running Python 3.8.3 so is its pip (Python 3.8.3) by installing Pygments with pip for python 3 will it be able to be detected by my web2pywhich is  running Python 2.7.16 or are there gonna be compatibility issues? Coz right now I have installed Pygments on my laptopn but i'm still getting the same error!


On Monday, July 20, 2020 at 11:04:45 AM UTC+2, Nico Zanferrari wrote:
Hi,

you just need to:

pip install pygments

on your system, but beware to use the right pip program corresponding to the python version you're using. In this way web2py's book application will be able to use it ;-)

Nico


Il giorno lun 20 lug 2020 alle ore 10:53 mostwanted <godir...@gmail.com> ha scritto:
I have downloaded the web2py book app but when I try to open from my laptop i get this error flashing:
web2py book error ImportError: Requires pygments module, but it is not available!

I am using web2py  Version 2.20.4, how do I resolve it?

Regards;

Mostwanted

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

Clemens

unread,
Jul 20, 2020, 9:19:54 AM7/20/20
to web2py-users
Hi,

I'm also using Python 2 and 3 in parallel. I'm not using Pygments but other pipped libraries. And I'm using pip for the Python2 version and pip3 for Python3 version. Having installed both versions I'm just running Python 2 or 3 and the right library is linked.

Furthermore I'm using update-alternatives (Ubuntu/Linux) to switch between Python2 and 3, especially for testing that both versions are served by my web2py app.

Hope, I could help!

Nico Zanferrari

unread,
Jul 20, 2020, 9:21:32 AM7/20/20
to web...@googlegroups.com
No,
 
this is a bad idea, don't try it. Instead, let the right version of Python use its own pip version; in your case:

python2.7 -m pip install pygments

should work fine. See here for details.

Nico

Il giorno lun 20 lug 2020 alle ore 14:59 mostwanted <godir...@gmail.com> ha scritto:
I feel like I'm about to ask a very ironic question but I need to know so here goes; So my web2py is running python Python 2.7.16 but my system is running Python 3.8.3 so is its pip (Python 3.8.3) by installing Pygments with pip for python 3 will it be able to be detected by my web2pywhich is  running Python 2.7.16 or are there gonna be compatibility issues?

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/0b41d818-605f-42f3-a017-83233270253co%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages