OS X and Python 2.7

175 views
Skip to first unread message

Doug Hellmann

unread,
Dec 27, 2010, 4:59:31 PM12/27/10
to pyenchant users
Has anyone built an egg of PyEnchant with all of its dependencies
under Python 2.7?

Thanks,
Doug

Ryan Kelly

unread,
Dec 27, 2010, 5:09:48 PM12/27/10
to pyencha...@googlegroups.com
On Mon, 2010-12-27 at 13:59 -0800, Doug Hellmann wrote:
> Has anyone built an egg of PyEnchant with all of its dependencies
> under Python 2.7?

I've been holding off until someone requests them. I'll roll some eggs
for win32 and osx and upload them today, and will make 2.7 part of the
regular release build from now on.


Cheers,

Ryan

--
Ryan Kelly
http://www.rfk.id.au | This message is digitally signed. Please visit
ry...@rfk.id.au | http://www.rfk.id.au/ramblings/gpg/ for details

signature.asc

Ryan Kelly

unread,
Dec 27, 2010, 6:46:02 PM12/27/10
to pyencha...@googlegroups.com, Doug Hellmann
On Mon, 2010-12-27 at 13:59 -0800, Doug Hellmann wrote:
> Has anyone built an egg of PyEnchant with all of its dependencies
> under Python 2.7?

The egg is now available from PyPI. A dmg installer and a win32 egg coming soon.

signature.asc

Doug Hellmann

unread,
Dec 28, 2010, 10:39:26 AM12/28/10
to pyenchant users


On Dec 27, 6:46 pm, Ryan Kelly <r...@rfk.id.au> wrote:
> On Mon, 2010-12-27 at 13:59 -0800, Doug Hellmann wrote:
> > Has anyone built an egg of PyEnchant with all of its dependencies
> > under Python 2.7?
>
> The egg is now available from PyPI.  A dmg installer and a win32 egg coming soon.

Excellent, thanks!

I'll probably wait for the dmg installer, since it has all of the
dependencies (the egg doesn't, right?).

Doug

Ryan Kelly

unread,
Dec 30, 2010, 4:53:17 PM12/30/10
to pyencha...@googlegroups.com

The egg *should* be fully self-contained, with all the same bundled
dependencies as the dmg installer. If it's not working for you, please
file a bug. The only caveat is that you must have setuptools installed,
as it needs to use the "eager resources" feature that isn't supported by
standard zipimport.

(I regularly forget this, test my eggs on a raw python install, and
panic that my build process has been broken - it's confusing because the
egg *seems* to work but fails when it goes to load the bundled dlls).

signature.asc

Doug Hellmann

unread,
Dec 31, 2010, 12:03:18 PM12/31/10
to pyenchant users


On Dec 30, 4:53 pm, Ryan Kelly <r...@rfk.id.au> wrote:
> On Tue, 2010-12-28 at 07:39 -0800, Doug Hellmann wrote:
>
> > On Dec 27, 6:46 pm, Ryan Kelly <r...@rfk.id.au> wrote:
> > > On Mon, 2010-12-27 at 13:59 -0800, Doug Hellmann wrote:
> > > > Has anyone built an egg of PyEnchant with all of its dependencies
> > > > under Python 2.7?
>
> > > The egg is now available from PyPI.  A dmg installer and a win32 egg coming soon.
>
> > Excellent, thanks!
>
> > I'll probably wait for the dmg installer, since it has all of the
> > dependencies (the egg doesn't, right?).
>
> The egg *should* be fully self-contained, with all the same bundled
> dependencies as the dmg installer.  If it's not working for you, please
> file a bug.  The only caveat is that you must have setuptools installed,
> as it needs to use the "eager resources" feature that isn't supported by
> standard zipimport.
>
> (I regularly forget this, test my eggs on a raw python install, and
> panic that my build process has been broken - it's confusing because the
> egg *seems* to work but fails when it goes to load the bundled dlls).

Ah, my mistake. I assumed the egg was just PyEnchant itself. I'll give
it a try and report back if I have problems.

Thanks,
Doug

Doug Hellmann

unread,
Feb 27, 2011, 7:05:04 PM2/27/11
to pyenchant users
On Dec 30 2010, 4:53 pm, Ryan Kelly <r...@rfk.id.au> wrote:
> On Tue, 2010-12-28 at 07:39 -0800, Doug Hellmann wrote:
>
> > On Dec 27, 6:46 pm, Ryan Kelly <r...@rfk.id.au> wrote:
> > > On Mon, 2010-12-27 at 13:59 -0800, Doug Hellmann wrote:
> > > > Has anyone built an egg of PyEnchant with all of its dependencies
> > > > under Python 2.7?
>
> > > The egg is now available from PyPI.  A dmg installer and a win32 egg coming soon.
>
> > Excellent, thanks!
>
> > I'll probably wait for the dmg installer, since it has all of the
> > dependencies (the egg doesn't, right?).
>
> The egg *should* be fully self-contained, with all the same bundled
> dependencies as the dmg installer.  If it's not working for you, please
> file a bug.  The only caveat is that you must have setuptools installed,
> as it needs to use the "eager resources" feature that isn't supported by
> standard zipimport.
>
> (I regularly forget this, test my eggs on a raw python install, and
> panic that my build process has been broken - it's confusing because the
> egg *seems* to work but fails when it goes to load the bundled dlls).

The DMG installer on PyPI tells me it can't install on my system
because it needs "/opt/local/Library/Frameworks Python 2.7". I don't
know what that is, is it an alternate Python distribution of some
sort?

I tried the egg via easy_install and got an error because the enchant
C libraries aren't available on my system (those are the dependencies
I thought were in the egg).

Building enchant itself from source wants some other tools I don't
have installed on my system (pkg-config is the first one it mentions,
but I think I got past that before and there was something else). The
only binaries I'm finding for enchant seem to be part of the AbiWord
installer. Is there a way to pull what I need out of the app?

Doug

Ryan Kelly

unread,
Feb 27, 2011, 7:20:06 PM2/27/11
to pyencha...@googlegroups.com
On Sun, 2011-02-27 at 16:05 -0800, Doug Hellmann wrote:
> On Dec 30 2010, 4:53 pm, Ryan Kelly <r...@rfk.id.au> wrote:
> > On Tue, 2010-12-28 at 07:39 -0800, Doug Hellmann wrote:
> >
> > > On Dec 27, 6:46 pm, Ryan Kelly <r...@rfk.id.au> wrote:
> > > > On Mon, 2010-12-27 at 13:59 -0800, Doug Hellmann wrote:
> > > > > Has anyone built an egg of PyEnchant with all of its dependencies
> > > > > under Python 2.7?
> >
> > > > The egg is now available from PyPI. A dmg installer and a win32 egg coming soon.
> >
> > > Excellent, thanks!
> >
> > > I'll probably wait for the dmg installer, since it has all of the
> > > dependencies (the egg doesn't, right?).
> >
> > The egg *should* be fully self-contained, with all the same bundled
> > dependencies as the dmg installer. If it's not working for you, please
> > file a bug. The only caveat is that you must have setuptools installed,
> > as it needs to use the "eager resources" feature that isn't supported by
> > standard zipimport.
> >
> > (I regularly forget this, test my eggs on a raw python install, and
> > panic that my build process has been broken - it's confusing because the
> > egg *seems* to work but fails when it goes to load the bundled dlls).
>
> The DMG installer on PyPI tells me it can't install on my system
> because it needs "/opt/local/Library/Frameworks Python 2.7". I don't
> know what that is, is it an alternate Python distribution of some
> sort?

Hmmm, perhaps I have accidentally compiled it against a non-system
Python library. I'm still feeling my way through the finer points of
packaging on OSX.

Can you please remind me what version of python you're using? I'll try
to take a look over the next couple of days.

> I tried the egg via easy_install and got an error because the enchant
> C libraries aren't available on my system (those are the dependencies
> I thought were in the egg).

Yes, they should be in the egg, but it's possible that this error is
cased by the same problem that's causing the DMG installed to fail.

This error is also sometimes caused by not having setuptools installed
properly (setuptools is required since the egg needs to eagerly-load the
dylibs from the zipfile).

> Building enchant itself from source wants some other tools I don't
> have installed on my system (pkg-config is the first one it mentions,
> but I think I got past that before and there was something else). The
> only binaries I'm finding for enchant seem to be part of the AbiWord
> installer. Is there a way to pull what I need out of the app?

You could try unzipping the egg and adding the contained "enchant"
folder directly to your sys.path. It should have enchant and supporting
dylibs under there.

If it doesn't work with this folder directly in your sys.path, it's
probably a problem with the way I've built it.

signature.asc

Doug Hellmann

unread,
Feb 28, 2011, 8:12:17 AM2/28/11
to pyenchant users
Sorry, I should have included that. I'm on Python 2.7.

> > I tried the egg via easy_install and got an error because the enchant
> > C libraries aren't available on my system (those are the dependencies
> > I thought were in the egg).
>
> Yes, they should be in the egg, but it's possible that this error is
> cased by the same problem that's causing the DMG installed to fail.

Oh, that makes sense.

> This error is also sometimes caused by not having setuptools installed
> properly (setuptools is required since the egg needs to eagerly-load the
> dylibs from the zipfile).

I am using distribute, and am installing PyEnchant into a virtualenv.
My understanding is that distribute is setuptools with some bug fixes,
so I assumed it would work. Maybe not?

>
> > Building enchant itself from source wants some other tools I don't
> > have installed on my system (pkg-config is the first one it mentions,
> > but I think I got past that before and there was something else). The
> > only binaries I'm finding for enchant seem to be part of the AbiWord
> > installer. Is there a way to pull what I need out of the app?
>
> You could try unzipping the egg and adding the contained "enchant"
> folder directly to your sys.path.  It should have enchant and supporting
> dylibs under there.

I don't know why I didn't think of that! I'll give that a try and let
you know how it goes.

>
> If it doesn't work with this folder directly in your sys.path, it's
> probably a problem with the way I've built it.
>
>   Cheers,
>
>     Ryan
>
> --
> Ryan Kellyhttp://www.rfk.id.au |  This message is digitally signed. Please visit
> r...@rfk.id.au        |  http://www.rfk.id.au/ramblings/gpg/for details
>
>  signature.asc
> < 1KViewDownload

Doug Hellmann

unread,
Apr 17, 2011, 3:26:49 PM4/17/11
to pyenchant users
Unzipping the egg file and then placing the "enchant" directory on my
import path seems to be working.

Installing the egg with easy_install gave me this error:

$ easy_install ~/Downloads/pyenchant-1.6.5-py2.7-macosx-10.4-
universal.egg
install_dir /Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/
lib/python2.7/site-packages/
Processing pyenchant-1.6.5-py2.7-macosx-10.4-universal.egg
creating /Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/
lib/python2.7/site-packages/pyenchant-1.6.5-py2.7-macosx-10.4-
universal.egg
Extracting pyenchant-1.6.5-py2.7-macosx-10.4-universal.egg to /Users/
dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/python2.7/site-
packages
Adding pyenchant 1.6.5 to easy-install.pth file

Installed /Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/
lib/python2.7/site-packages/pyenchant-1.6.5-py2.7-macosx-10.4-
universal.egg
Processing dependencies for pyenchant==1.6.5
Searching for pyenchant==1.6.5
Reading http://pypi.python.org/simple/pyenchant/
Reading http://www.rfk.id.au/software/pyenchant/
Reading http://pyenchant.sourceforge.net/
Best match: pyenchant 1.6.5
Downloading http://pypi.python.org/packages/source/p/pyenchant/pyenchant-1.6.5.tar.gz#md5=565014a14a52fb0195d152dd492ea948
Processing pyenchant-1.6.5.tar.gz
Running pyenchant-1.6.5/setup.py -q bdist_egg --dist-dir /var/folders/
9R/9R1t+tR02Raxzk+F71Q50U+++Uw/-Tmp-/easy_install-MlvsFw/
pyenchant-1.6.5/egg-dist-tmp-5Fk2_s
Traceback (most recent call last):
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/bin/
easy_install", line 9, in <module>
load_entry_point('distribute==0.6.14', 'console_scripts',
'easy_install')()
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 1855, in main
with_ei_usage(lambda:
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 1836, in with_ei_usage
return f()
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 1859, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 342, in run
self.easy_install(spec, not self.no_deps)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 562, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 614, in install_item
self.process_distribution(spec, dist, deps)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 666, in process_distribution
[requirement], self.local_index, self.easy_install
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py",
line 544, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py",
line 786, in best_match
return self.obtain(req, installer) # try and download/install
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py",
line 798, in obtain
return installer(requirement)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 582, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 612, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 802, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 1079, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/command/
easy_install.py", line 1068, in run_setup
run_setup(setup_script, args)
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/
sandbox.py", line 29, in run_setup
lambda: execfile(
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/
sandbox.py", line 70, in run
return func()
File "/Users/dhellmann/Envs/8484837d-8d3b-4414-ac0b-6d7bfa64b251/lib/
python2.7/site-packages/distribute-0.6.14-py2.7.egg/setuptools/
sandbox.py", line 31, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 195, in <module>
'user_scripts =
virtualenvwrapper.user_scripts:post_activate_source',
File "/var/folders/9R/9R1t+tR02Raxzk+F71Q50U+++Uw/-Tmp-/easy_install-
MlvsFw/pyenchant-1.6.5/enchant/__init__.py", line 90, in <module>
File "/var/folders/9R/9R1t+tR02Raxzk+F71Q50U+++Uw/-Tmp-/easy_install-
MlvsFw/pyenchant-1.6.5/enchant/_enchant.py", line 133, in <module>
ImportError: enchant C library not found

I don't know why it would be trying to download the source for
PyEnchant if the egg is right there. Maybe I am using the wrong
incantation of easy_install?

Doug

Viktor Haag

unread,
Nov 1, 2011, 12:06:42 PM11/1/11
to pyencha...@googlegroups.com


On Sunday, 17 April 2011 15:26:49 UTC-4, Doug Hellmann wrote:


Unzipping the egg file and then placing the "enchant" directory on my
import path seems to be working.

... snip ... 

ImportError: enchant C library not found

I'm on an OSX Lion installation, using both the system-native Python 2.7.1 and PyPy 1.6.1, and I can't seem to install the for-2.7 PyEnchant distribution either. I've tried installing from the DMG (and get the "can't find /opt/local etcetc" error message), from the egg ("enchant C library not found") using easy_install, and unzipping the egg, moving 'enchant' into /Library/Python/2.7/site-packages (i.e onto sys.path) and trying to use pip to install pyenchant.

Does anyone know if we yet have a working DMG or .egg install or PyEnchant for Python 2.7 (on Lion)? Or what I can do to try to make it work? (For example, I can see that the egg has the built dynamic libs for enchant: how do I make the PyEnchant installation process get ahold of them?)

I'd really like to try to avoid having to build enchant from source myself, as to do so seems to require all sorts of dependencies I'd rather not have to concern myself with. (For example, when I looked to see how to install it from Fink, the list of dependencies I'd have to also install was frighteningly large, including a host of Fink's Python packages -- code that Lion already has 8P.)

Can anyone assist? I'm using Sphinx, and I'd quite like to be able to install and use PyEnchant in our toolchain here...

--
Viktor
Reply all
Reply to author
Forward
0 new messages