471,339 Members | 1,292 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,339 software developers and data experts.

Python Problem

Hi,

The line:

import enchant

works perfectly OK when I call a Python progrma (sp.py) from IDLE
(WInXP). When I try to run it ftom the command line (python sp.py) the
response is:

Traceback (most recent call last):
File "sp.py", line 3, in <module>
import enchant
ImportError: No module named enchant

Searching my computer (the whole of drive c:\) I could not find ANY
file called enchant.*.

Does anyone know what is wrong?

Thanks

((:-() Meir
Sep 8 '07 #1
6 3850
On Fri, 2007-09-07 at 21:58 -0400, Wiseman wrote:
Hi,

The line:

import enchant

works perfectly OK when I call a Python progrma (sp.py) from IDLE
(WInXP). When I try to run it ftom the command line (python sp.py) the
response is:

Traceback (most recent call last):
File "sp.py", line 3, in <module>
import enchant
ImportError: No module named enchant
Enchant is a third-party package that must have been installed
separately. The most likely cause for the problem you're seeing is that
you have two Python versions on your computer, one with Enchant
installed, one without, and you're running the GUI of the one that does
have Enchant and the command line of the one that doesn't.

It's possible that the cause is something else, but to eliminate the
most obvious solution, run "import sys; print sys.version" in each
Python and check if they differ.
Searching my computer (the whole of drive c:\) I could not find ANY
file called enchant.*.
It is not necessary to have a file called enchant-dot-anything anywhere
on your disk to successfully import enchant as a module. The module
could also be built-in, stored inside a zip-file, or it could be a
package.

In enchant's case, it's a package, i.e. somewhere on your disk you'll
find a folder called "enchant" with a file "__init__.py" inside it.

To find out quickly where "enchant" is, simply issue "print enchant"
after importing enchant in IDLE. It'll tell you from where the module
was loaded.

HTH,

--
Carsten Haese
http://informixdb.sourceforge.net
Sep 8 '07 #2
Carsten.

I want to thank you for your help. I could not check this until this
morning. Now that I checked your answer - THANK YOU.
I do have 2 installations of Python on my machine. Once I called
Python with a full path - my program orked as expected.

Meir
Sep 11 '07 #3

Hi,

OK - it works in WindowsXP.
I installed "enchant" on my SuSE 10.0 (using YAST).
The enchant Suse package looks like a general Linux package, not a
Python specific.

Running the program in Python I am getting the same error message from
the line: "import enchant".

ImportError: No module named enchant

What am I missing?

Thanks

((:-() Meir

>Hi,

The line:

import enchant

works perfectly OK when I call a Python progrma (sp.py) from IDLE
(WInXP). When I try to run it ftom the command line (python sp.py) the
response is:

Traceback (most recent call last):
File "sp.py", line 3, in <module>
import enchant
ImportError: No module named enchant

Searching my computer (the whole of drive c:\) I could not find ANY
file called enchant.*.

Does anyone know what is wrong?

Thanks

((:-() Meir
Sep 11 '07 #4
On 2007-09-11, Wiseman <mi****@disney.comwrote:
>
Hi,

OK - it works in WindowsXP.
I installed "enchant" on my SuSE 10.0 (using YAST).
The enchant Suse package looks like a general Linux package, not a
Python specific.
You'd seem to be right judging by this web-page:
http://www.novell.com/products/linux...x/enchant.html

As you can see, there is no file installed at a path with "python" in it.
What am I missing?
Python bindings to the library perhaps?
You may be more lucky with an enchant-dev package (if it exists). I am however
not a Suse user and not an echant user (well, not from my Python code at least).
Albert

Sep 12 '07 #5
On Wed, 12 Sep 2007 09:09:02 +0200, A.T.Hofkamp wrote:
On 2007-09-11, Wiseman <mi****@disney.comwrote:
>>
Hi,

OK - it works in WindowsXP.
I installed "enchant" on my SuSE 10.0 (using YAST).
The enchant Suse package looks like a general Linux package, not a
Python specific.

You'd seem to be right judging by this web-page:
http://www.novell.com/products/linux...x/enchant.html

As you can see, there is no file installed at a path with "python" in it.
>What am I missing?

Python bindings to the library perhaps?
You may be more lucky with an enchant-dev package (if it exists). I am however
not a Suse user and not an echant user (well, not from my Python code at least).
PyEnchant seems to be an independent project:

http://pyenchant.sourceforge.net/

So there is either an extra package for SuSE or the OP has to build it
himself.

Ciao,
Marc 'BlackJack' Rintsch
Sep 12 '07 #6
Marc,

Thank you.

I followed the instructions in given at pyenchant.sourceforge.net and
got the application to work.

((;-))
Meir

PS: My challenge now is to port the application to Redhat.
I already know that Redhat is missing the pyenchant package - I hope
the same installation process will solve the problem. It also missing
"threading" and this will be the story for another day.

I'll appreciate any hint from anyone who've already solved such a
problem

M
----------------------------------------------------------------

On 12 Sep 2007 07:33:52 GMT, Marc 'BlackJack' Rintsch <bj****@gmx.net>
wrote:
>On Wed, 12 Sep 2007 09:09:02 +0200, A.T.Hofkamp wrote:
>On 2007-09-11, Wiseman <mi****@disney.comwrote:
>>>
Hi,

OK - it works in WindowsXP.
I installed "enchant" on my SuSE 10.0 (using YAST).
The enchant Suse package looks like a general Linux package, not a
Python specific.

You'd seem to be right judging by this web-page:
http://www.novell.com/products/linux...x/enchant.html

As you can see, there is no file installed at a path with "python" in it.
>>What am I missing?

Python bindings to the library perhaps?
You may be more lucky with an enchant-dev package (if it exists). I am however
not a Suse user and not an echant user (well, not from my Python code at least).

PyEnchant seems to be an independent project:

http://pyenchant.sourceforge.net/

So there is either an extra package for SuSE or the OP has to build it
himself.

Ciao,
Marc 'BlackJack' Rintsch
Sep 12 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.