python - Can't install numpy with setup.py -
i'm on python 2.7 , i'm trying use nltk part of speech tagger, generates error because don't have numpy installed:
> traceback (most recent call last): file "<stdin>", line 1, in <module> file "/library/python/2.7/site-packages/nltk/tag/__init__.py", line 99, in pos_tag tagger = load(_pos_tagger) file "/library/python/2.7/site-packages/nltk/data.py", line 605, in load resource_val = pickle.load(_open(resource_url)) importerror: no module named numpy.core.multiarray so download numpy 1.7.0 here, did cd downloads folder , did python setup.py install , got error:
running numpy source directory. non-existing path in 'numpy/distutils': 'site.cfg' f2py version 2 blas_opt_info: found: extra_link_args = ['-wl,-framework', '-wl,accelerate'] define_macros = [('no_atlas_info', 3)] extra_compile_args = ['-msse3', '-i/system/library/frameworks/veclib.framework/headers'] lapack_opt_info: found: extra_link_args = ['-wl,-framework', '-wl,accelerate'] define_macros = [('no_atlas_info', 3)] extra_compile_args = ['-msse3'] running install running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building py_modules sources creating build creating build/src.macosx-10.6-intel-2.7 creating build/src.macosx-10.6-intel-2.7/numpy creating build/src.macosx-10.6-intel-2.7/numpy/distutils building library "npymath" sources customize gnu95fcompiler not locate executable gfortran not locate executable f95 customize nagfcompiler customize absoftfcompiler not locate executable f90 not locate executable f77 customize ibmfcompiler not locate executable xlf90 not locate executable xlf customize intelfcompiler not locate executable ifort not locate executable ifc customize gnufcompiler not locate executable g77 customize g95fcompiler not locate executable g95 customize pgroupfcompiler not locate executable pgfortran don't know how compile fortran code on platform 'posix' c compiler: gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -o2 -dndebug -g -o3 compile options: '-inumpy/core/src/private -inumpy/core/src -inumpy/core -inumpy/core/src/npymath -inumpy/core/src/multiarray -inumpy/core/src/umath -inumpy/core/src/npysort -inumpy/core/include -i/library/frameworks/python.framework/versions/2.7/include/python2.7 -c' gcc-4.2: _configtest.c sh: gcc-4.2: command not found sh: gcc-4.2: command not found failure. removing: _configtest.c _configtest.o traceback (most recent call last): file "setup.py", line 214, in <module> setup_package() file "setup.py", line 207, in setup_package configuration=configuration ) file "/users/mikaschiller/downloads/numpy-1.7.0/numpy/distutils/core.py", line 186, in setup return old_setup(**new_attr) 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/mikaschiller/downloads/numpy-1.7.0/numpy/distutils/command/install.py", line 55, in run r = old_install.run(self) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/command/install.py", line 563, in run self.run_command('build') file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() file "/users/mikaschiller/downloads/numpy-1.7.0/numpy/distutils/command/build.py", line 37, in run old_build.run(self) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run self.run_command(cmd_name) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() file "/users/mikaschiller/downloads/numpy-1.7.0/numpy/distutils/command/build_src.py", line 152, in run self.build_sources() file "/users/mikaschiller/downloads/numpy-1.7.0/numpy/distutils/command/build_src.py", line 163, in build_sources self.build_library_sources(*libname_info) file "/users/mikaschiller/downloads/numpy-1.7.0/numpy/distutils/command/build_src.py", line 298, in build_library_sources sources = self.generate_sources(sources, (lib_name, build_info)) file "/users/mikaschiller/downloads/numpy-1.7.0/numpy/distutils/command/build_src.py", line 385, in generate_sources source = func(extension, build_dir) file "numpy/core/setup.py", line 648, in get_mathlib_info raise runtimeerror("broken toolchain: cannot link simple c program") runtimeerror: broken toolchain: cannot link simple c program i tried install sudo pip install -u numpy , got same "cannot link simple c program" error. can't figure out what's going on here. numpy version incompatible python 2.7 or perhaps nltk?
the module depends on working c build chain. depends on system how install it, google in case.
you can see looking gcc:
sh: gcc-4.2: command not found on debian-based linux install , python headers (edited per comment):
sudo apt-get install build-essential python-dev
Comments
Post a Comment