include python libraries that needed in web2py app to distribute to another

30 views
Skip to first unread message

黄祥

unread,
Jun 8, 2018, 9:15:50 PM6/8/18
to web2py-users
ref:

question:
1. which folder that must be included in app modules/ (e.g. ~/web2py/applications/init/modules) folder?
e.g.
$ ls -l ~/miniconda3/envs/python2
drwxr-xr-x  42 sugizo  staff  1428 May 21 07:28 bin
drwxr-xr-x  19 sugizo  staff   646 May 20 18:57 conda-meta
drwxr-xr-x  91 sugizo  staff  3094 May 20 18:57 include
drwxr-xr-x  92 sugizo  staff  3128 May 20 18:57 lib
drwxr-xr-x   8 sugizo  staff   272 May 20 18:57 share
drwxr-xr-x   7 sugizo  staff   238 May 20 18:57 ssl
2. what is the different above method with pip install python_packages or using pip install -r requirements.txt ?
3. or even with pyinstaller (not sure can work to bundle python libraries for *nix environment), comment ?

ref pyinstaller:

thanks and best regards,
stifan

Massimo Di Pierro

unread,
Jun 14, 2018, 10:18:38 PM6/14/18
to web2py-users
1) You can only include in modules/ pure python modules and, even in that case, not all of them work f they expect to be in "site-packages".
2) the difference is that by putting modules in the app/modules folder, they will be distributed with your app and user does not need to call pip. Also pip installed modules are shared among all apps, some times that can reate conflicts. Anyway, if a module is pip install-able,  would use pip. I used the modules folder only for custom modules.
3) I never used pyinstaller, I would just distribute your app with a list of dependencies or use docker.

黄祥

unread,
Jun 14, 2018, 11:00:05 PM6/14/18
to web2py-users
clear enough, thx for detail explaination, massimo. tested using pyinstaller, but end with error

best regards,
stifan
Reply all
Reply to author
Forward
0 new messages