我正在使用 Ubuntu,并通过文档中记录的命令安装了 bigquery 命令行工具:“easy_install bigquery”(不带引号 - 另请参阅https://developers.google.com/bigquery/bq-command-line-tool#安装) - 由于对 python2.7 路径的访问权限导致错误,我不得不将命令更改为“sudo easy_install bigquery”。
现在每次我尝试从命令行运行命令“bq”时,都会出现以下错误:“IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/bigquery-2.0 .14-py2.7.egg/EGG-INFO/requires.txt'"
如果我使用命令“sudo bq”运行它,它运行良好,但我想运行 bigquery 而不必将它作为 sudo 运行。我确定我做错了什么,但我不知道是什么。有什么建议么?
这是完整的跟踪:
:~$ bq
Traceback (most recent call last):
File "/usr/local/bin/bq", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2803, in <module>
working_set.require(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 696, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 599, in resolve
requirements.extend(dist.requires(req.extras)[::-1])
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2235, in requires
dm = self._dep_map
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2227, in _dep_map
for extra,reqs in split_sections(self._get_metadata(name)):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2759, in split_sections
for line in yield_lines(s):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1915, in yield_lines
for ss in strs:
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2249, in _get_metadata
for line in self.get_metadata_lines(name):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1219, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1211, in get_metadata
return self._get(self._fn(self.egg_info,name))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1326, in _get
stream = open(path, 'rb')
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/bigquery-2.0.14-py2.7.egg/EGG-INFO/requires.txt'
谢谢,