Came upon NLTK while browsing library holding for Python materials, and as I'm interested in seeing how I might use AI and similar things to expedite my research into ancient cuneiform documents, I'm quite excited about the prospects. I'm on MacOS 10.7.2
Yesterday, went to nltk.org and verified that my Python was new enough--in fact it's 2.7.1 (I see that this might conceivably result in issues, but would like to stick with it if I can, before downgrading.) Did the first stage of the instal, had an issue with "llvm-gcc-4.2: No such file or directory". I did a search, and from what I can tell, it does indeed exist, at /Developers/usr/llvm-gcc-4.2/bin/, so I'm thinking that this wasn't in the path being searched, somehow.
I tried to figure out where this was being called, but to no avail (I suppose I just don't know where to look). Given the precarious warning that sudo gives, I didn't want to start mucking about uninformed and make things worse... thought I'd best ask first.
I've posted the log below. If someone could tell me how to fix this and rerun/continue so as to end up with a tidy result, I'd be appreciative!
Best
Karljürgen
======
. sudo python setup.py install
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-intel-2.7
creating build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/__init__.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/composer.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/constructor.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/cyaml.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/dumper.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/emitter.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/error.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/events.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/loader.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/nodes.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/parser.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/reader.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/representer.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/resolver.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/scanner.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/serializer.py -> build/lib.macosx-10.7-intel-2.7/yaml
copying lib/yaml/tokens.py -> build/lib.macosx-10.7-intel-2.7/yaml
running build_ext
creating build/temp.macosx-10.7-intel-2.7
checking if libyaml is compilable
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c build/temp.macosx-10.7-intel-2.7/check_libyaml.c -o build/temp.macosx-10.7-intel-2.7/check_libyaml.o
unable to execute llvm-gcc-4.2: No such file or directory
libyaml is not found or a compiler error: forcing --without-libyaml
(if libyaml is installed correctly, you may need to
specify the option --include-dirs or uncomment and
modify the parameter include_dirs in setup.cfg)
running install_lib
creating /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/__init__.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/composer.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/constructor.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/cyaml.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/dumper.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/emitter.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/error.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/events.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/loader.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/nodes.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/parser.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/reader.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/representer.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/resolver.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/scanner.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/serializer.py -> /Library/Python/2.7/site-packages/yaml
copying build/lib.macosx-10.7-intel-2.7/yaml/tokens.py -> /Library/Python/2.7/site-packages/yaml
byte-compiling /Library/Python/2.7/site-packages/yaml/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/composer.py to composer.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/constructor.py to constructor.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/cyaml.py to cyaml.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/dumper.py to dumper.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/emitter.py to emitter.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/error.py to error.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/events.py to events.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/loader.py to loader.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/nodes.py to nodes.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/parser.py to parser.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/reader.py to reader.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/representer.py to representer.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/resolver.py to resolver.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/scanner.py to scanner.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/serializer.py to serializer.pyc
byte-compiling /Library/Python/2.7/site-packages/yaml/tokens.py to tokens.pyc
running install_egg_info
Writing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
Karljürgen G. Feuerherm, PhD
Undergraduate Advisor
Department of Archaeology and Classical Studies
Wilfrid Laurier University
75 University Avenue West
Waterloo, Ontario N2L 3C5
Tel. (519) 884-1970 x3193
Fax (519) 883-0991 (ATTN Arch. & Classics)
Regards,
--
Ronan Amicel
> --
> You received this message because you are subscribed to the Google Groups "nltk-users" group.
> To post to this group, send email to nltk-...@googlegroups.com.
> To unsubscribe from this group, send email to nltk-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nltk-users?hl=en.
>
On Dec 4, 2011, at 14:53, "Karljurgen Feuerherm" <kfeue...@wlu.ca> wrote:
Did the first stage of the instal, had an issue with "llvm-gcc-4.2: No such file or directory". I did a search, and from what I can tell, it does indeed exist, at /Developers/usr/llvm-gcc-4.2/bin/, so I'm thinking that this wasn't in the path being searched, somehow. I tried to figure out where this was being called, but to no avail (I suppose I just don't know where to look). Given the precarious warning that sudo gives, I didn't want to start mucking about uninformed and make things worse... thought I'd best ask first.
You can modify your path without any risk of lasting damage, just for the call to sudo, like this: env PATH="$PATH:/Developers/usr/llvm-gcc-4.2/bin/" sudo python setup.py install
-- _____________________________________________ Alexis Dimitriadis A.Dimi...@uu.nl +31-30-253-6568 Utrecht Institute of Linguistics OTS Trans 10 3512 JK Utrecht The Netherlands
now i found a MacOS 10.6.x in college and i try this... And i get
message too. But everything is works! It's not a big problem, because
the gcc default installed your computer, but it's now in your path.
(Try: echo $PATH, you don't found the /Developers/usr/llvm-gcc-4.2/
bin/ path in your $PATH)
If you don't get this messegas, you need copy the gcc and llvm-gcc
from /Developers/usr/llvm-gcc-4.2/bin/ to /usr/bin/ if you want use
gcc and llvm-gcc everywhere in your computer. Or add this path to your
$PATH variable. But the PyYAML is installed without this copy. And
NLTK also works!
Best,
David
Thanks for the response.
Ok--went to the pip site, got redirected to: http://pypi.python.org/pypi/pip,
where I was informed that I had to "must first install setuptools or
distribute. If you use virtualenv...". I gather from some other
comments on the pip instal page that it might be better to use
'virtualenv'. There's an example but at this point I don't have any
clue what they're talking about or why to prefer one over the other...
XCode: yes, have that installed (3.2.6, according to "about").
Presumably the latest version, since software update runs regularly.
gcc -v when run from a terminal window gives me a 'command not found'.
I wonder whether this means I've stomped on $path while trying to
examine it... if so, have no idea how to return it to what it was
before...
But if I find gcc manually (I know from experience it defaulted to
-4.2):
.cd /Developer/usr/bin
I get:
. gcc-4.2 -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-
checking --enable-werror --prefix=/usr --mandir=/share/man --enable-
languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/
$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-
prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-
apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
Your ls command doesn't work, no gcc entry there; but now that I'm in /
Developer/usr/bin,
. ls -l gcc-4.2
-rwxr-xr-x 1 root wheel 166128 24 Oct 2010 gcc-4.2
Does this help? (Sorry if I'm a bit obtuse. Just migrated to Mac last
year...)
K
K
On Dec 4, 10:47 am, Richard Careaga <leuc...@gmail.com> wrote:
On Dec 4, 11:59 am, Richard Careaga <leuc...@gmail.com> wrote:
> Virtualenv is good when you are working on multiple projects
...
> At least I do. You can use
> pip, happily, without it, by installing distribute.
Ok, I'll do that....
> Installing the latest Xcode ought to take care of your path problems,
> but you can try this in the meantime, creating a softlink
>
> % cd /usr/bin
> % sudo ln -s /Developer/usr/bin/gcc .
>
Did this, thanks. I've been using XCode directly to learn Objective-C
lately, so I guess it never dawned on me that when I upgraded to Lion,
the command line gcc might quit working. Haven't used it in a year or
so...!
> or, if you are using the bash shell, add to the BEGINNING of your PATH
...
> % source .bash_profile
It's .profile, I think? (or is that for something else)
echo $path gets me a blank line, btw.
So, having done the softlink, do I take it I should 1) instal
distribute 2) rerun the original sudo to install the pyaml? 3) do the
second step of the installation for NLTK, and 4) update XCode
tomorrow...?
Many thanks!
K
Virtualenv is good when you are working on multiple projects with modules that you may or may not want to have permanently in your site packages. Essentially, it creates a parallel python universe in your home directory for each of the virtual environments. Of course, you then need some package to keep track of them all. At least I do. You can use pip, happily, without it, by installing distribute. (setuptools was long the only way to semi-automatically install modules, but pip is more modern; you can still download manually and use setup.py, but that's fraught with its own challenges).
Installing the latest Xcode ought to take care of your path problems, but you can try this in the meantime, creating a softlink
% cd /usr/bin
% sudo ln -s
/Developer/usr/bin/gcc .
My first suggestion is to install pip (http://pypi.python.org/pypi/pip). Second, make sure you have the current XCode installed (through the App Store). You should get
$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
Then if
$ pip install pyyaml
doesn't work, you may have a path problem to resolve, with an older version of gcc taking precedence over the version in /Developer. Yours should look like
ls -l /usr/bin/gcc
lrwxr-xr-x 1 rc wheel 12 Nov 30 18:26 /usr/bin/gcc -> llvm-gcc-4.2
Alexis
Ok, thanks. I do know about ., .., and ˜, no worries there.
On Dec 4, 12:54 pm, Richard Careaga <leuc...@gmail.com> wrote:
> Since you get zip when you
>
> $ echo $PATH
Turns out I typed echo $path (lowercase). with echo $PATH, I get: /opt/
local/bin:.:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/
usr/texbin, which is reassuring!
I did try to instal distribute. That didn't work either. Here's the
log:
. curl -O http://python-distribute.org/distribute_setup.py
% Total % Received % Xferd Average Speed Time Time
Time Current
Dload Upload Total Spent
Left Speed
100 15757 100 15757 0 0 5271 0 0:00:02 0:00:02
--:--:-- 12446
. python distribute_setup.py
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.24.tar.gz
Extracting in /var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH
Now working in /var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH/distribute-0.6.24
Installing Distribute
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /System/Library/Frameworks/
Python.framework/Versions/2.7/Extras/lib/python
Non-egg installation
Removing elements out of the way...
Renaming /System/Library/Frameworks/Python.framework/Versions/2.7/
Extras/lib/python/setuptools-0.6c12dev_r85381-py2.7.egg-info into /
System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/
python/setuptools-0.6c12dev_r85381-py2.7.egg-info.OLD.1323019419.53
Traceback (most recent call last):
File "setup.py", line 127, in <module>
_before_install()
File "/private/var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH/distribute-0.6.24/distribute_setup.py", line 348, in
_before_install
_fake_setuptools()
File "/private/var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH/distribute-0.6.24/distribute_setup.py", line 402, in
_fake_setuptools
res = _remove_flat_installation(setuptools_location)
File "/private/var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH/distribute-0.6.24/distribute_setup.py", line 222, in
__no_sandbox
return function(*args, **kw)
File "/private/var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH/distribute-0.6.24/distribute_setup.py", line 273, in
_remove_flat_installation
patched = _patch_egg_dir(pkg_info)
File "/private/var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH/distribute-0.6.24/distribute_setup.py", line 222, in
__no_sandbox
return function(*args, **kw)
File "/private/var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH/distribute-0.6.24/distribute_setup.py", line 333, in
_patch_egg_dir
_rename_path(path)
File "/private/var/folders/qh/b3s5hvv936v_3m7s53rpwh_r0000gn/T/
tmpxRYoAH/distribute-0.6.24/distribute_setup.py", line 254, in
_rename_path
os.rename(path, new_name)
OSError: [Errno 13] Permission denied
Something went wrong during the installation.
See the error message above.
Curiouser and curiouser.... Any thoughts on this one?
K
K
. cd Downloads/PyYAML-3.09
. env PATH="$PATH:/Developers/usr/llvm-gcc-4.2/bin/" sudo python
setup.py install
Password:
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
Writing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
No error reference to llvm-gcc-4.2. Can I assume all is well, then?
Best
K
On Dec 4, 1:09 pm, Alexis Dimitriadis <alexis.dimitria...@gmail.com>
wrote:
Thanks. I tried your temporary $PATH workaround, and got this much
abbreviated log (I assume that's because a lot of it got done the
first time):
. cd Downloads/PyYAML-3.09
. env PATH="$PATH:/Developers/usr/llvm-gcc-4.2/bin/" sudo python
setup.py install
Password:
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
Writing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
No error reference to llvm-gcc-4.2. Can I assume all is well, then?
Best
K
On Dec 4, 1:09 pm, Alexis Dimitriadis <alexis.dimitria...@gmail.com>
That should be $PATH; it's case sensitive. It's definitely set, otherwise (almost) nothing on the commandline would be working.
Alexis
K
Looks good. Have you installed NLTK itself yet? If that gives you more
dependency trouble, try copying the entire nltk folder to
site-packages/nltk before you go fetching too many add-ons. Should be
enough to get "import nltk" to work.
Alexis
No, not yet. A task for tomorrow. And thanks for the heads up.
K
On Dec 4, 5:46 pm, Alexis Dimitriadis <alexis.dimitria...@gmail.com>
wrote:
Hi
No, not yet. A task for tomorrow. And thanks for the heads up.
K
On Dec 4, 5:46 pm, Alexis Dimitriadis <alexis.dimitria...@gmail.com>
Thanks. I tried your temporary $PATH workaround, and got this much
abbreviated log (I assume that's because a lot of it got done the
first time):
. cd Downloads/PyYAML-3.09
. env PATH="$PATH:/Developers/usr/llvm-gcc-4.2/bin/" sudo python
setup.py install
Password:
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
Writing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
No error reference to llvm-gcc-4.2. Can I assume all is well, then?
Best
K
On Dec 4, 1:09 pm, Alexis Dimitriadis <alexis.dimitria...@gmail.com>
That should be $PATH; it's case sensitive. It's definitely set, otherwise (almost) nothing on the commandline would be working.
Alexis
Today I got XCode updated (a few minutes as opposed to 30 hours at
home, which died part way through, as usual, anyway...), installed
distribute, and NLTK. I should be good to start working with the NL/
Python manual now.
I appreciate everyone's advice and help! Now, here's to getting some
actual progress done :)
K
On Dec 4, 9:32 pm, Richard Careaga <leuc...@gmail.com> wrote:
> While copying the whole nltk folder to the site-packages directory may
> work, it also commits you do maintaining it manually, since the config
> files that easy_setup or pip rely on don't get updated to reflect the
> state of the version. I'd do this only on a spare set-up that you don't
> mind doing a fresh OS install if things go really south on you.
>
>
>
>
>
>
>
> > Karlj�rgen <mailto:kfeuerh...@wlu.ca>
> > December 4, 2011 7:58 PM
> > Hi
>
> > No, not yet. A task for tomorrow. And thanks for the heads up.
>
> > K
>
> > On Dec 4, 5:46 pm, Alexis Dimitriadis <alexis.dimitria...@gmail.com>
>
> > Karlj�rgen <mailto:kfeuerh...@wlu.ca>
> > December 4, 2011 1:38 PM
> > Thanks. I tried your temporary $PATH workaround, and got this much
> > abbreviated log (I assume that's because a lot of it got done the
> > first time):
>
> > . cd Downloads/PyYAML-3.09
> > . env PATH="$PATH:/Developers/usr/llvm-gcc-4.2/bin/" sudo python
> > setup.py install
> > Password:
> > running install
> > running build
> > running build_py
> > running build_ext
> > running install_lib
> > running install_egg_info
> > Removing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
> > Writing /Library/Python/2.7/site-packages/PyYAML-3.09-py2.7.egg-info
>
> > No error reference to llvm-gcc-4.2. Can I assume all is well, then?
>
> > Best
>
> > K
>
> > On Dec 4, 1:09 pm, Alexis Dimitriadis <alexis.dimitria...@gmail.com>
>
> > Alexis Dimitriadis <mailto:alexis.dimitria...@gmail.com>
> > December 4, 2011 1:09 PM
>
> > That should be $PATH; it's case sensitive. It's definitely set,
> > otherwise (almost) nothing on the commandline would be working.
>
> > Alexis
>
> > Karlj�rgen <mailto:kfeuerh...@wlu.ca>