1

I tried to install and run gsutil and am getting the following error:

Traceback (most recent call last):
  File "/Users/groovebug/gsutil/gsutil", line 88, in <module>
    sys.exit(gslib.__main__.main())
  File "/Users/groovebug/gsutil/gslib/__main__.py", line 93, in main
    command_runner = CommandRunner(config_file_list)
  File "/Users/groovebug/gsutil/gslib/command_runner.py", line 102, in __init__
    self.command_map = self._LoadCommandMap()
  File "/Users/groovebug/gsutil/gslib/command_runner.py", line 112, in _LoadCommandMap
    __import__('gslib.commands.%s' % module_name)
  File "/Users/groovebug/gsutil/gslib/commands/disablelogging.py", line 18, in <module>
    from gslib.command import CONFIG_REQUIRED
ImportError: cannot import name CONFIG_REQUIRED

I reinstalled and continued to get it, and haven't found anyone solving it elsewhere.

2 Answers 2

3

gsutil no longer uses that variable. If you update to the latest version of gsutil this problem should no longer happen:

gsuil update

3
  • I downloaded from this link several times today. I was getting the error for every command I tried to run including update and help. The actual cause may have been an old .boto file or something else because once I added that line and was able to get it to run gsutil config -b once, everything started working well even after I reran tar xfz gsutil.tar.gz -C $HOME on the same tar. (Sorry if you got duplicate notifications, I hit enter thinking it would give me a new line.) Commented Sep 17, 2013 at 20:02
  • Are you sure you were running the new version you installed from the gsutil.tar.gz file? For example, might you have the older gsutil installed somewhere else on your PATH and have run that one? The current code doesn't have CONFIG_REQUIRED anywhere, so that's the only explanation I could imagine for why you continue to see this problem. Commented Sep 18, 2013 at 0:45
  • I'm not 100% sure, but I'm pretty sure. I'd like to be able to time travel to go back and check it. I can't find a pre-3.35 version anywhere on my computer. As I said above, I was able to remove the change as soon as I was able to get it to run once. (But I did run update as soon as I was able to get it to run once). However, it outputted that I already had the latest version. After reading your answer, I rebuilt the tar, and doing so did not resurrect the problem. I moved the working folder before rebuilding the tar. The only occurrence of that variable is the one I added. Was a strange bug. Commented Sep 18, 2013 at 16:55
0

CONFIG_REQUIRED is just a constant name for a key used in a dictionary.

If you open ${Directory_Containing_gsutil}/gsutil/gslib/command.py

and add the line

CONFIG_REQUIRED = 'config_required'

it solves the problem. Not sure why that line is missing.

Not the answer you're looking for? Browse other questions tagged or ask your own question.