There is a "bug" in custom import. If the module fails to load because
of a bug in the imported module you get the error below instead of a
more explicit error. You can use local_import to debug. This needs to
be resolved.

On Aug 17, 6:58 pm, Niphlod <niph...@gmail.com> wrote:
> Hi all, I have a problem deploying my app to a VPS.
>
> I created an app with linkedin support, 
> usinghttps://github.com/mrgaaron/LinkedIn-Client-Library.
> Just to avoid to install this module systemwide, I put it under myapp/
> modules folder.
>
> myapp
>   - modules
>     - liclient
>         - __init__.py (containing class LinkedInAPI)
>
> Now, the weird part: in a model I defined some helper functions, that
> I call later on some controllers.
> In these,  I call "from liclient import LinkedInAPI" .
> All is working fine on the local system, but in the VPS - an exact
> copy of the local environment - this call throws an exception.
>
> Traceback (most recent call last):
>   File "/home/niphlod/production/web2py/gluon/restricted.py", line
> 192, in restricted
>     exec ccode in environment
>   File "/home/niphlod/production/web2py/applications/whoisper/models/
> default/linkedin_helpers.py", line 25, in <module>
>     from liclient import LinkedInAPI
>   File "/home/niphlod/production/web2py/gluon/custom_import.py", line
> 280, in __call__
>     fromlist, level)
>   File "/home/niphlod/production/web2py/gluon/custom_import.py", line
> 74, in __call__
>     level)
> ImportError: No module named liclient
>
> Am I doing something wrong? Any hints or tips ?
>
> PS: in the local system the library is not installed, i.e. if I open a
> python shell and type "from liclient import LinkedInAPI" response is
> "ImportError: No module named liclient". The same thing happens in the
> VPS.
>
> sys.path is the same for the local and the VPS system.

Reply via email to