How to use conda installed packages in web2py

32 views
Skip to first unread message

Davidiam

unread,
Feb 21, 2020, 9:22:44 AM2/21/20
to web...@googlegroups.com
Hi,


We have an application that requires the pandas package.  We thought we could just install pandas in the conda environment used for running web2py, but when we do "import pandas" in web2py we get an error message that it can't find pandas and it seems to be looking for pandas in the modules folder of the application.


There are a few similar questions that I found on Google but none of them had a clear answer.  Is it possible to import conda installed libraries in web2py applications without having to copy them (and all dependances) to within the web2py framework ?
If so, how can we do this ?




Here is the error we are getting :


------------




web2py Web Framework


Created by Massimo Di
Pierro, Copyright 2007-2020


Version
2.18.5-stable+timestamp.2019.04.08.04.22.03


Database drivers available:
sqlite3, imaplib, pymysql, pyodbc



['', 'D:\\Data\\QFG\\site-packages', 'D:\\Data\\QFG', 'D:\\Data\\QFG\\gluon\\packages\\yatl', 'D:\\Data\\QFG\\gluon\\packages\\dal', 'D:\\Python\\Miniconda3\\python37.zip', 'D:\\Python\\Miniconda3\\DLLs', 'D:\\Python\\Miniconda3\\lib', 'D:\\Python\\Miniconda3',
'D:\\Python\\Miniconda3\\lib\\site-packages',
'D:\\Python\\Miniconda3\\lib\\site-packages\\win32', 'D:\\Python\\Miniconda3\\lib\\site-packages\\win32\\lib', 'D:\\Python\\Miniconda3\\lib\\site-packages\\Pythonwin', 'D:\\Python\\Miniconda3\\envs\\web2py_QFG\\Lib\\site-packages']






Traceback (most recent call
last):


  File "D:\Data\QFG\gluon\shell.py", line 275, in run


    execfile(startfile,
_env)


  File "D:\Data\QFG\gluon\shell.py", line 41, in execfile


    exec(code, global_vars,
local_vars)


  File "D:\Data\QFG\APPLiCATIONS\REPORTING\TEST\PythonInfo.py", line 14, in <module>


    import
pandas


  File "D:\Data\QFG\gluon\custom_import.py", line 85, in custom_importer


    return
base_importer(pname, globals, locals, fromlist, level)


ModuleNotFoundError: No
module named 'applications.CRE.modules.pandas'


 


 -------



Kind Regards,
David
Reply all
Reply to author
Forward
0 new messages