Related
I am trying to install pandas to use in my python code. I was able to upgrade my pip using pip install upgrade pip but when I try to install pandas using pip install pandas I get the following errors:
Traceback (most recent call last):
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\fcompiler\compaq.py", line 78
, in CompaqVisualFCompiler
m.initialize()
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\msvccompiler.py", line 48, in
initialize
_MSVCCompiler.initialize(self)
File "C:\msys64\mingw64\lib\python3.9\distutils\msvccompiler.py", line 259, in initialize
self.__paths = self.get_msvc_paths("path")
File "C:\msys64\mingw64\lib\python3.9\distutils\msvccompiler.py", line 602, in get_msvc_paths
r"\Win32 (%s)\Directories" % (self.__root, platform))
AttributeError: 'MSVCCompiler' object has no attribute '_MSVCCompiler__root'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Brian\AppData\Local\Temp\tmp94oxoujq_in_process.py", line 363, in <module>
main()
File "C:\Users\Brian\AppData\Local\Temp\tmp94oxoujq_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\Brian\AppData\Local\Temp\tmp94oxoujq_in_process.py", line 164, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "C:\Users\Brian\AppData\Local\Temp\pip-build-env-tr54un10\overlay\lib\python3.9\site-packages\setuptools\build_meta.py", line 157, in prepare
e_metadata_for_build_wheel
self.run_setup()
File "C:\Users\Brian\AppData\Local\Temp\pip-build-env-tr54un10\overlay\lib\python3.9\site-packages\setuptools\build_meta.py", line 248, in run_se
tup
super(_BuildMetaLegacyBackend,
File "C:\Users\Brian\AppData\Local\Temp\pip-build-env-tr54un10\overlay\lib\python3.9\site-packages\setuptools\build_meta.py", line 142, in run_se
tup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 508, in <module>
setup_package()
File "setup.py", line 500, in setup_package
setup(**metadata)
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\core.py", line 169, in setup
return old_setup(**new_attr)
File "C:\Users\Brian\AppData\Local\Temp\pip-build-env-tr54un10\overlay\lib\python3.9\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "C:\msys64\mingw64\lib\python3.9\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\msys64\mingw64\lib\python3.9\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\msys64\mingw64\lib\python3.9\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Brian\AppData\Local\Temp\pip-build-env-tr54un10\overlay\lib\python3.9\site-packages\setuptools\command\dist_info.py", line 31, in
run
egg_info.run()
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\command\egg_info.py", line 24
, in run
self.run_command("build_src")
File "C:\msys64\mingw64\lib\python3.9\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\msys64\mingw64\lib\python3.9\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\command\build_src.py", line 1
44, in run
self.build_sources()
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\command\build_src.py", line 1
55, in build_sources
self.build_library_sources(*libname_info)
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\command\build_src.py", line 2
88, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\command\build_src.py", line 3
78, in generate_sources
source = func(extension, build_dir)
File "numpy\core\setup.py", line 658, in get_mathlib_info
st = config_cmd.try_link('int main(void) { return 0;}')
File "C:\msys64\mingw64\lib\python3.9\distutils\command\config.py", line 241, in
try_link
self._check_compiler()
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\command\config.py", line 80,
in _check_compiler
self.fcompiler = new_fcompiler(compiler=self.fcompiler,
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\fcompiler\__init__.py", line
876, in new_fcompiler
load_all_fcompiler_classes()
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\fcompiler\__init__.py", line
777, in load_all_fcompiler_classes
__import__ (module_name)
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\fcompiler\compaq.py", line 54
, in <module>
class CompaqVisualFCompiler(FCompiler):
File "C:\Users\Brian\AppData\Local\Temp\pip-install-i72pcle8\numpy_328f6081d36f426b90572be17f203722\numpy\distutils\fcompiler\compaq.py", line 83
, in CompaqVisualFCompiler
if '_MSVCCompiler__root' in str(msg):
NameError: name 'msg' is not defined
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[end of output]
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Before upgrading my pip, I tried installing pandas but none of the versions that I tried to install would download; however, I don't think I was getting these same errors before I upgraded pip. Can someone help me figure out how to install pandas? Is there a different way that I need to install it without using pip install pandas?
Remove the NumPy then try to install pandas again.
pip uninstall package_name
I am working with Py2exe to generate an executable in Python(anaconda 3) and it gives me this error.
running py2exe
Error: Namespace packages not yet supported: Skipping package 'win32com.gen_py'
Traceback (most recent call last):
File "setup.py", line 32, in <module>
**kwargs)
File "C:\Program Files\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Program Files\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
...
File "C:\Program Files\Anaconda3\lib\site-packages\py2exe\mf3.py", line 261, in _gcd_import
name = self._resolve_name(name, package, level)
File "C:\Program Files\Anaconda3\lib\site-packages\py2exe\mf3.py", line 213, in _resolve_name
raise ValueError('attempted relative import beyond top-level package')
ValueError: attempted relative import beyond top-level package
I am now trying to run a program on a super computer on which I cannot run sudo or easy_install. The program needs pandas so I need to pip install pandas but I keep getting this error message even thought I have tried "pip install --upgrade pip" already.
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
--edit--
Here is the error message when I pip3 install pandas.
pip3 install pandas
Collecting pandas
Using cached pandas-0.22.0.tar.gz
Complete output from command python setup.py egg_info:
Running from numpy source directory.
/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py:369: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
/usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/system_info.py:624: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
/usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
/usr/lib64/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 239, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 269, in run
return func()
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 238, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py", line 394, in <module>
File "/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py", line 386, in setup_package
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/core.py", line 169, in setup
File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.4/site-packages/setuptools/command/bdist_egg.py", line 151, in run
self.run_command("egg_info")
File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/egg_info.py", line 26, in run
File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 148, in run
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 165, in build_sources
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 377, in generate_sources
File "numpy/core/setup.py", line 422, in generate_config_h
return tag
File "numpy/core/setup.py", line 48, in check_types
min_numpy_ver = '1.9.0'
File "numpy/core/setup.py", line 281, in check_types
pjoin(ujson_lib,'ultrajsondec.c'),
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-xqyfs1o1/pandas/setup.py", line 743, in <module>
**setuptools_kwargs)
File "/usr/lib64/python3.4/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 268, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 312, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1091, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1103, in obtain
return installer(requirement)
File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 379, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 638, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 668, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 851, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1079, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1065, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 242, in run_setup
raise
File "/usr/lib64/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib64/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 141, in resume
compat.reraise(type, exc, self._tb)
File "/usr/lib/python3.4/site-packages/setuptools/compat.py", line 69, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 239, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 269, in run
return func()
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 238, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py", line 394, in <module>
File "/tmp/easy_install-gv5il123/numpy-1.14.1/setup.py", line 386, in setup_package
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/core.py", line 169, in setup
File "/usr/lib64/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.4/site-packages/setuptools/command/bdist_egg.py", line 151, in run
self.run_command("egg_info")
File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/egg_info.py", line 26, in run
File "/usr/lib64/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 148, in run
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 165, in build_sources
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
File "/tmp/easy_install-gv5il123/numpy-1.14.1/numpy/distutils/command/build_src.py", line 377, in generate_sources
File "numpy/core/setup.py", line 422, in generate_config_h
return tag
File "numpy/core/setup.py", line 48, in check_types
min_numpy_ver = '1.9.0'
File "numpy/core/setup.py", line 281, in check_types
pjoin(ujson_lib,'ultrajsondec.c'),
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
/tmp/easy_install-gv5il123/numpy-1.14.1/temp/tmpsx06jzi5/source.c:1:19: fatal error: cblas.h: No such file or directory
#include <cblas.h>
^
compilation terminated.
/tmp/easy_install-gv5il123/numpy-1.14.1/temp/tmpsx06jzi5/source.c:1:19: fatal error: cblas.h: No such file or directory
#include <cblas.h>
^
compilation terminated.
non-existing path in 'numpy/distutils': 'site.cfg'
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
int exp (void);
^~~
_configtest.o: In function `main':
/tmp/easy_install-gv5il123/numpy-1.14.1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.o: In function `main':
/tmp/easy_install-gv5il123/numpy-1.14.1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
int exp (void);
^~~
_configtest.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
_configtest.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-build-xqyfs1o1/pandas/
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
You are missing the packages python-dev and python-devel.
But since you are not root on that server you probably cannot install them yourself. Basically you could ask the administrator if he could install them for you.
I would recommend installing a local version of Python and install the packages there.
By the way: Since you are not root pip would fail anyways since you probably do not have the right to globally install packages. You should use pip install <package> --user instead.
Under Ubuntu 16.04 and Python 2.7.12 sudo -H pip install pyublas fails with the following stacktrace:
Collecting pyublas
Using cached PyUblas-2013.1.tar.gz
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz
Extracting in /tmp/tmpnYhYMx
Now working in /tmp/tmpnYhYMx/distribute-0.6.35
Building a Distribute egg in /tmp/pip-build-vvsChR/pyublas
Traceback (most recent call last):
File "setup.py", line 248, in <module>
scripts = scripts,
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/tmp/tmpnYhYMx/distribute-0.6.35/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/tmp/tmpnYhYMx/distribute-0.6.35/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2027, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2237, in requires
dm = self._dep_map
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2466, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2499, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2496, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/tmp/tmpnYhYMx/distribute-0.6.35/_markerlib/markers.py", line 109, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'sys_platform' is not defined
/tmp/pip-build-vvsChR/pyublas/distribute-0.6.35-py2.7.egg
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-vvsChR/pyublas/setup.py", line 143, in <module>
main()
File "/tmp/pip-build-vvsChR/pyublas/setup.py", line 29, in main
from aksetup_helper import hack_distutils, get_config, setup, \
File "aksetup_helper.py", line 3, in <module>
distribute_setup.use_setuptools()
File "distribute_setup.py", line 152, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "distribute_setup.py", line 132, in _do_download
_build_egg(egg, tarball, to_dir)
File "distribute_setup.py", line 123, in _build_egg
raise IOError('Could not build the egg.')
IOError: Could not build the egg.
Following various related SO answers, I have confirmed that distribute is not installed, setuptools is up to date (setuptools (36.0.1)).
I have also tried manually running setup per this answer to no avail.
I am trying to install GDAL in virtual environment based on the various solutions out there.
However the download itself already fails:
$ pip install --no-install GDAL
Here is the pip.log
------------------------------------------------------------
/Users/test/venv/bin/pip run on Sun Jun 2 15:35:15 2013
Downloading/unpacking GDAL
Running setup.py egg_info for package GDAL
running egg_info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/Users/test/venv/build/GDAL/setup.py", line 267, in <module>
ext_modules = ext_modules )
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 14, in replacement_run
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 259, in find_sources
mm.run()
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 325, in run
self.add_defaults()
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 361, in add_defaults
sdist.add_defaults(self)
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/sdist.py", line 211, in add_defaults
build_ext = self.get_finalized_command('build_ext')
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/Users/test/venv/build/GDAL/setup.py", line 164, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/Users/test/venv/build/GDAL/setup.py", line 144, in get_gdal_config
return fetch_config(option)
File "/Users/test/venv/build/GDAL/setup.py", line 97, in fetch_config
raise gdal_config_error, e""")
File "<string>", line 4, in <module>
__main__.gdal_config_error: [Errno 2] No such file or directory
Complete output from command python setup.py egg_info:
running egg_info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/Users/test/venv/build/GDAL/setup.py", line 267, in <module>
ext_modules = ext_modules )
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 14, in replacement_run
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 259, in find_sources
mm.run()
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 325, in run
self.add_defaults()
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py", line 361, in add_defaults
sdist.add_defaults(self)
File "/Users/test/venv/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/sdist.py", line 211, in add_defaults
build_ext = self.get_finalized_command('build_ext')
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/Users/test/venv/build/GDAL/setup.py", line 164, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/Users/test/venv/build/GDAL/setup.py", line 144, in get_gdal_config
return fetch_config(option)
File "/Users/test/venv/build/GDAL/setup.py", line 97, in fetch_config
raise gdal_config_error, e""")
File "<string>", line 4, in <module>
__main__.gdal_config_error: [Errno 2] No such file or directory
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /Users/test/venv/build/GDAL
Exception information:
Traceback (most recent call last):
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
status = self.run(options, args)
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1057, in prepare_files
req_to_install.run_egg_info()
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 236, in run_egg_info
command_desc='python setup.py egg_info')
File "/Users/test/venv/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 662, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /Users/test/venv/build/GDAL
What am I missing?
The workaround given by #user1738154 didn't work as expected for me so went ahead and installed GDAL using HomeBrew then using pip into my Virtual environment.
$ brew install gdal
(venv)$ pip install GDAL
Everything compiled and ran like a charm.
A workaround to that problem is to
Download GDAL Complete from this site
Install GDAL Complete.pkg
Go to /Library/Frameworks/GDAL.framework/Versions/1.10/ and copy all files in there
Go to your virtual environment's sites-packages /venv/lib/python2.7/site-packages and paste the copied files in there
after install gdal using these steps on host:
sudo apt-get install gdal-bin
sudo apt-get install libgdal-dev
After that use
pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"
This should work like charm