gpt4 book ai didi

python - 无法在 Google Datalab Jupyter 笔记本中安装 pyproj 模块

转载 作者:太空宇宙 更新时间:2023-11-04 10:03:38 26 4
gpt4 key购买 nike

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

方法一:从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

方法二:使用pip

!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?

最佳答案

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

关于python - 无法在 Google Datalab Jupyter 笔记本中安装 pyproj 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42098899/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com