1

Ich versuche, Pyproj in einem Google Datalab Jupyter-Notizbuch als eine erforderliche Abhängigkeit für die Grundkartenbibliothek zu installieren. Ich habe zwei Methoden ausprobiert, unnötig zu sagen, keiner hat funktioniert.Kann Pyproj-Modul in Google Datalab Jupyter-Notizbuch nicht installieren

Methode 1: von git Klonen

!git clone https://github.com/jswhit/pyproj.git 

Ausgänge:

Cloning into 'pyproj'... 
remote: Counting objects: 2811, done. 
remote: Total 2811 (delta 0), reused 0 (delta 0), pack-reused 2810 
Receiving objects: 100% (2811/2811), 5.65 MiB | 1.55 MiB/s, done. 
Resolving deltas: 100% (1951/1951), done. 
Checking connectivity... done. 

Und installieren Befehl:

!python ./pyproj/setup.py install 

Ausgänge:

using bundled proj4.. 
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory 
Traceback (most recent call last): 
    File "./pyproj/setup.py", line 86, in <module> 
    objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c']) 
    File "/usr/lib/python2.7/distutils/ccompiler.py", line 574, in compile 
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) 
    File "/usr/lib/python2.7/distutils/unixccompiler.py", line 122, in _compile 
    raise CompileError, msg 
distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

Methode 2: pip

!pip install pyproj 

Ausgänge:

Collecting pyproj 
Using cached pyproj-1.9.5.1.tar.gz 
Complete output from command python setup.py egg_info: 
unable to execute 'x86_64-linux-gnu-gcc': No such file or directory 
using bundled proj4.. 
Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    File "/tmp/pip-build-FcWGXL/pyproj/setup.py", line 72, in <module> 
    objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c']) 
    File "/usr/lib/python2.7/distutils/ccompiler.py", line 574, in compile 
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) 
    File "/usr/lib/python2.7/distutils/unixccompiler.py", line 122, in _compile 
    raise CompileError, msg 
distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-FcWGXL/pyproj/ 

Was kann Methode verwendet werden pyproj installieren innerhalb eines Datalab Jupyter Notebook?

Antwort

4

Sieht so aus, als müssten Sie gcc bauen. Do apt-get update && apt-get install -y gcc in einer Zelle dann versuchen Sie die pip install pyproj erneut.

+0

Das funktionierte. Ich verneige mich vor deinem Python-Wissen. Danke nochmal für deine Hilfe! – goose

Verwandte Themen