在Jupyter笔记本中安装google-cloud-bigquery

时间:2017-02-10 21:50:45

标签: python jupyter-notebook google-cloud-sql

我试图在Jupyter笔记本中安装google-cloud-bigquery,如下所示:

!pip install --upgrade google-cloud-bigquery

这会运行一段时间,但随后会出现权限问题:

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/google_auth-0.6.0-py2.7-nspkg.pth'

这表明了什么,我该如何解决?我尝试使用sudo运行,但不知道如何输入密码。

1 个答案:

答案 0 :(得分:0)

您可以尝试使用Pyenv。 Pyenv不使用系统Python,而是在主目录中使用Python可执行文件。它修改了你的路径,所以包也安装在你的主分区中。