2013-06-02 34 views
6

Tôi đang cố cài đặt GDAL trong môi trường ảo dựa trên solutions khác nhau.Python GDAL: pip install --no-install GDAL không thành công

Tuy nhiên việc tải xuống bản thân đã thất bại:

$ pip install --no-install GDAL 

Đây là 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 

tôi đang thiếu gì?

Trả lời

4

Một cách giải quyết cho vấn đề đó là

  1. Tải GDAL Complete từ this site
  2. Cài đặt GDAL Complete.pkg
  3. Đến /Library/Frameworks/GDAL.framework/Versions/1.10/ và sao chép tất cả các file trong đó
  4. Tới trang web môi trường ảo của bạn -package /venv/lib/python2.7/site-packages và dán các tệp đã sao chép vào đó
+0

Cảm ơn! Làm việc hoàn hảo! – rebelliard

7

Cách giải quyết được đưa ra bởi @ user1738154 không hoạt động như mong đợi đối với tôi, vì vậy hãy tiếp tục và cài đặt GDAL bằng cách sử dụng HomeBrew sau đó sử dụng pip vào môi trường ảo của tôi.

$ brew install gdal 
    (venv)$ pip install GDAL 

Mọi thứ được biên soạn và chạy như một nét duyên dáng.

+1

Điều này làm việc tuyệt vời, cảm ơn! Hãy chắc chắn để làm một "cập nhật brew" như gói lzip đã được reved từ 1,14 đến 1,15 trong công thức GDAL mới nhất. – jatal

Các vấn đề liên quan