本文介绍了无法在Google Datalab Jupyter笔记本中安装pyproj模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在尝试将pyproj安装在Google Datalab Jupyter笔记本中,作为底图库的必需依赖项.我尝试了两种方法,不用说都没有用.

I'm trying to install pyproj within a Google Datalab Jupyter notebook as a required dependency for the basemap library. I've tried two methods, needless to say neither has worked.

方法1:从git克隆

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

输出:

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.

并安装命令:

!python ./pyproj/setup.py install

输出:

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

方法2:使用点子

!pip install pyproj

输出:

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/

可以使用什么方法从Datalab Jupyter笔记本中安装pyproj?

What method can be used to install pyproj from within a Datalab Jupyter notebook?

推荐答案

看起来您需要gcc才能构建它.在单元格中执行apt-get update && apt-get install -y gcc,然后再次尝试.

Looks like you need gcc for it to build. Do apt-get update && apt-get install -y gcc in a cell then try the pip install pyproj again.

这篇关于无法在Google Datalab Jupyter笔记本中安装pyproj模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 11:12