Monday, 9 September 2013

Commandline Tool giving permission denied due to python path

Commandline Tool giving permission denied due to python path

I am using Ubuntu, and installed the bigquery commandline tool through the
command documented in the docs using: "easy_install bigquery" (without
quotes - see also
https://developers.google.com/bigquery/bq-command-line-tool#installation)
- as that resulted in an error because of access rights to the python2.7
path, I had to change the command to "sudo easy_install bigquery".
Now everytime I try to run the command "bq" from the commandline, I get
the following error: "IOError: [Errno 13] Permission denied:
'/usr/local/lib/python2.7/dist-packages/bigquery-2.0.14-py2.7.egg/EGG-INFO/requires.txt'"
It runs fine if I run it with the command "sudo bq" but I would like to
run bigquery without having to run it as sudo. I am sure I did something
wrong but I can't figure out what. Any suggestions?
Here is the complete trace:
:~$ 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'
Thanks,

No comments:

Post a Comment