Installing Enchant on Ubuntu

5,360 views
Skip to first unread message

ghy...@gmail.com

unread,
Mar 8, 2016, 3:33:29 PM3/8/16
to pyenchant users
Hi all, 

Relatively new to Python and Linux, so apologies in advance.. but:

Cannot seem to get Enchant running on my machine. 
I have Python 3.4.3 and Ubuntu 14.04. 

I get the following: 

Python 3.4.3 (default, Oct 14 2015, 20:33:09) 
[GCC 4.8.4] on linux
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> import random
>>> import enchant
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import enchant
ImportError: No module named 'enchant'
>>> 

From the command line I used the following:

sudo apt-get install libenchant1c2a
sudo python -m pip install pyenchant

I have noticed that the enchant folder sits in the python2.7-->dist-packages folder and not in the python3.4-->dist-packages. 
Not sure if that's an issue and if so, how to correct..?

Any advice appreciated :-)

Piotr Ozarowski

unread,
Mar 11, 2016, 7:22:22 PM3/11/16
to pyenchant users
[ghy...@gmail.com, 2016-03-08]
> Relatively new to Python and Linux, so apologies in advance.. but:

oh, that explains it. There are many bad and mean people out there that
tell innocent users to use sudo to overwrite files. It's all over
internet so I'm not surprised you were misled as well...

> Cannot seem to get Enchant running on my machine.
> I have Python 3.4.3 and Ubuntu 14.04.
>
> I get the following:
>
> Python 3.4.3 (default, Oct 14 2015, 20:33:09)
> [GCC 4.8.4] on linux
> Type "copyright", "credits" or "license()" for more information.
> >>> ================================ RESTART
> ================================
> >>> import random
> >>> import enchant
> Traceback (most recent call last):
> File "<pyshell#1>", line 1, in <module>
> import enchant
> ImportError: No module named 'enchant'
> >>>
>
> From the command line I used the following:
>
> sudo apt-get install libenchant1c2a
> sudo python -m pip install pyenchant

you should never ever use sudo with tools like pip, gem, npm or anything
else that is not apt or dpkg to install system files. This will break
your system! If your want pyenchant to be installed system-wide, just
`apt-get install python3-enchant` it. If for some reason that's not
enough for you (you need different version or given module is not
packaged) - use virtualenv or install to ~/.local. Do not ever
overwrite system files - it will break your system sooner or later (been
there several times thanks to my co-workers)
--
Piotr Ożarowski Debian GNU/Linux Developer
www.ozarowski.pl www.griffith.cc www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

ghy...@gmail.com

unread,
Mar 16, 2016, 3:23:33 PM3/16/16
to pyenchant users

Thanks Piotr!

I will give this a try and let you know how I get on. 

Regarding Linux.. yes, it is confusing when you first step into the fold. 
I've searched the web for a useful step by step guide and will continue looking. 

All I really want/need is a reasonable level of competency - if there are good resources (e-books or similar) you're aware of, would appreciate you pointing me to them!

G

ghy...@gmail.com

unread,
Mar 16, 2016, 3:23:37 PM3/16/16
to pyenchant users
Hi Piotr, 

So, I have just typed "apt-get install python3-enchant" at the shell. 
I get errors..

E: Could not open lock file /var/lib/dpkg/lock - open (13:Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg), are you root?

G

On Saturday, March 12, 2016 at 12:22:22 AM UTC, Piotr Ożarowski wrote:

Matt Bennett

unread,
Mar 16, 2016, 4:28:09 PM3/16/16
to pyencha...@googlegroups.com
This is going to seem confusing after Piotr's message, but what you need is "sudo apt-get install python3-enchant".

The difference is follows:

* apt-get is the way to install system packages on ubuntu. It will install a version of the requested software that the ubuntu maintainers have verified works harmoniously with the rest of the operating system. You need to be root to do it.
* pip (and "python -m pip", which is equivalent) is the way to install python packages. It's dangerous to do this to your system python because what it installs has not been verified to work harmoniously with the OS (hence Piotr's warning)

Hope that clears things up.



--
You received this message because you are subscribed to the Google Groups "pyenchant users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyenchant-use...@googlegroups.com.
To post to this group, send email to pyencha...@googlegroups.com.
Visit this group at https://groups.google.com/group/pyenchant-users.
For more options, visit https://groups.google.com/d/optout.

Piotr Ozarowski

unread,
Mar 16, 2016, 4:28:18 PM3/16/16
to pyenchant users
[ghy...@gmail.com, 2016-03-16]
> So, I have just typed "apt-get install python3-enchant" at the shell.
> I get errors..
>
> E: Could not open lock file /var/lib/dpkg/lock - open (13:Permission denied)
> E: Unable to lock the administration directory (/var/lib/dpkg), are you
> root?

that's the one where you need root rights (f.e. with sudo's help)
signature.asc

ghy...@gmail.com

unread,
Mar 22, 2016, 3:22:14 PM3/22/16
to pyenchant users
Thanks Piotr and Matt, 

Working fine now, appreciate your help!

G
Reply all
Reply to author
Forward
0 new messages