[Solved] ImprtError

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Solved] ImprtError

reda
This post was updated on .
hello,

i am trying to import some function from an external API like this:

from html2text import wrapwrite

but as a result, i've got this error message:
ImportError: cannot import name wrapwrite

for the information, the same instruction works good in the IDLE(python GUI)

thank you in advance.
Reply | Threaded
Open this post in threaded view
|

Re: ImprtError

reda
Thanks a lot for the help,

i've tried to debug just this following instruction:
import html2text
 print html2text.__file__
 print html2text.wrapwrite

the instruction :
print html2text.__file__ # works fine and results:
C:\Documents and Settings\admin\Bureau\html2text.pyc

but it still give error on:
 print html2text.wrapwrite

for your information the version of the python used with IDLE is the same with WingIDE (python 2.6)

how can i add the path of the API in project properties.
Reply | Threaded
Open this post in threaded view
|

Re: ImprtError

Wing IDE Support
On 12/6/10 9:08 AM, reda wrote:

> Thanks a lot for the help,
>
> i've tried to debug just this following instruction:
> import html2text
>   print html2text.__file__
>   print html2text.wrapwrite
>
> the instruction :
> print html2text.__file__ # works fine and results:
> C:\Documents and Settings\admin\Bureau\html2text.pyc
>
> but it still give error on:
>   print html2text.wrapwrite
>
> for your information the version of the python used with IDLE is the same
> with WingIDE (python 2.6)
>
> how can i add the path of the API in project properties.

In Project Properties in the Project menu in Wing, you can add items to
the Python Path property.  Then restart the debug process (and the
Python Shell if you are working in that; it can be restarted from its
Options menu).

My guess is that C:\Documents and Settings\admin\Bureau\html2text.pyc is
a copy of the module that omits wrapwrite and you actually want a
different one.

Or, try removing the *.pyc file in case it is corrupt.  It will be
regenerated by Python form the *.py file the next time you import it.

I just tried this with http://www.aaronsw.com/2002/html2text/ and it
works for me.

--

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

RE: ImprtError

reda
Thanks a lot, problem solved now.

it was an other old version of the html2text (the one mentioned in print html2text.__file__)
so, i've just deleted it, and the problem gone.

thank you again




Date: Mon, 6 Dec 2010 06:16:26 -0800
From: [hidden email]
To: [hidden email]
Subject: Re: ImprtError

On 12/6/10 9:08 AM, reda wrote:

> Thanks a lot for the help,
>
> i've tried to debug just this following instruction:
> import html2text
>   print html2text.__file__
>   print html2text.wrapwrite
>
> the instruction :
> print html2text.__file__ # works fine and results:
> C:\Documents and Settings\admin\Bureau\html2text.pyc
>
> but it still give error on:
>   print html2text.wrapwrite
>
> for your information the version of the python used with IDLE is the same
> with WingIDE (python 2.6)
>
> how can i add the path of the API in project properties.
In Project Properties in the Project menu in Wing, you can add items to
the Python Path property.  Then restart the debug process (and the
Python Shell if you are working in that; it can be restarted from its
Options menu).

My guess is that C:\Documents and Settings\admin\Bureau\html2text.pyc is
a copy of the module that omits wrapwrite and you actually want a
different one.

Or, try removing the *.pyc file in case it is corrupt.  It will be
regenerated by Python form the *.py file the next time you import it.

I just tried this with http://www.aaronsw.com/2002/html2text/ and it
works for me.

--

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide



Reply | Threaded
Open this post in threaded view
|

[Solved]Re: ImprtError

reda
This post has NOT been accepted by the mailing list yet.
In reply to this post by reda
Problem solved

it was another version ot html2text that omites the imported function.
i have deleted it and the problem gone
You were wright.

Thanks a lot