473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 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 3955
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: David MacQuigg | last post by:
I am starting a new thread so we can avoid some of the non-productive argument following my earlier post "What is good about Prothon". At Mr. Hahn's request, I will avoid using the name "Prothon"...
68
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
112
by: mystilleef | last post by:
Hello, What is the Pythonic way of implementing getters and setters. I've heard people say the use of accessors is not Pythonic. But why? And what is the alternative? I refrain from using them...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 417 open ( -6) / 3565 closed (+12) / 3982 total ( +6) Bugs : 960 open ( -3) / 6498 closed (+19) / 7458 total (+16) RFE : 266 open...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.