On Monday, June 10, 2019 at 2:31:33 PM UTC-7, Quang Lam wrote:
>
> Hi Johnathan, thanks for your suggestion. it's really helpful
>
> it turns out that the import psycopg2 in my module caused the problem. it
> i take out the import psycopg2, the import module works fine. However, i
> need to import psycopg2 to connect postgres database. how can i fix this
> situation ?
>
> Please help thanks
>
>
Talking to pyscopg2 is normally done through the DAL. The DAL may talk to
multiple databases.
db1 = DAL(myconf.take('db1.uri'), ....)
db2 = DAL(myconf.take('db2.uri'), ....)
/dps
On Monday, June 10, 2019 at 1:53:31 PM UTC-7, Jonathan Clark wrote:
>>
>> Hi,
>>
>> If you have two modules you are importing, and one works and the other
>> doesn't, why can't you:
>>
>> 1) Make them both the same content and see if you can still import both
>> or only one. If only one works, what can the difference be except the name
>> etc.
>>
>> 2) If they both import ok when they have identical content (but different
>> names), then gradually change one of them to be the content you actually
>> want to import, and see what it is that you change which makes the import
>> stop working?
>>
>> Good luck.
>>
>> On Monday, 10 June 2019 19:35:38 UTC+1, Quang Lam wrote:
>>>
>>> Hi Dave, i named the other modules with underscore too and it worked but
>>> i dont know why this one is not working, any other suggestion?
>>>
>>> On Friday, June 7, 2019 at 1:54:00 PM UTC-7, Dave S wrote:
>>>>
>>>>
>>>>
>>>> On Friday, June 7, 2019 at 1:24:23 PM UTC-7, Quang Lam wrote:
>>>>>
>>>>> Hi Dave
>>>>>
>>>>> i restarted the web2py, reloaded the adminpage but i still got the
>>>>> error saying no module named in the modules folder. i have no problem
>>>>> with
>>>>> the other modules except the new one named mode_extraction. Also, i
>>>>> checked
>>>>> my modules folder, web2py actually compiles the mode_extraction module
>>>>> because i saw the pyc file but i dont know why i got the error of no
>>>>> module
>>>>> named in the folder.
>>>>>
>>>>> Thanks
>>>>>
>>>>
>>>>
>>>> Ah! Maybe the custom importer is not handling the underscore. Try
>>>> renaming the module.
>>>>
>>>> /dps
>>>>
>>>>
>>>>> On Friday, June 7, 2019 at 1:16:44 PM UTC-7, Dave S wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Friday, June 7, 2019 at 10:33:09 AM UTC-7, Quang Lam wrote:
>>>>>>>
>>>>>>> i placed a new module file in the modules folder but i got the error
>>>>>>> saying there is no module named in the modules folder when i import the
>>>>>>> module. However, i can import the other modules in the modules folder
>>>>>>> but
>>>>>>> not the new one.
>>>>>>> Please help
>>>>>>>
>>>>>>
>>>>>> If you have appadmin enabled, the "sites" page has a reload button.
>>>>>> Otherwise, stop and restart web2py.
>>>>>> (I only use modules in Scheduler tasks, so it's just the -K that has
>>>>>> to be stop-and-go)
>>>>>>
>>>>>>
>>>>>> /dps
>>>>>>
>>>>>>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/f5fdd7f5-67cc-4fe9-a60b-15c75aa7b92b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.