First run errors

I was following the getting started guide and I spent quite some time going through all of the configuration options to get beets set up just how I want before I did anything else…
When I was finally ready to test run beets this is what happened:

beet config -p
configuration error: include must be a dictionary or a list, not str

…which I quickly fixed, but the documentation does clearly say to use a space-separated list. Anyway, so when I ran it again I got a lot more errors…

beet                                                                                                              
Traceback (most recent call last):                                                                                  
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\runpy.py", line 193, in _run_module_as_main                
    "__main__", mod_spec)                                                                                           
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\runpy.py", line 85, in _run_code                           
    exec(code, run_globals)                                                                                         
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\Scripts\beet.exe\__main__.py", line 9, in <module>             
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\ui\__init__.py", line 1266, in main    
    _raw_main(args)                                                                                                 
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\ui\__init__.py", line 1249, in _raw_mai
n                                                                                                                   
    subcommands, plugins, lib = _setup(options, lib)                                                                
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\ui\__init__.py", line 1131, in _setup  
    mb.configure()                                                                                                  
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\autotag\mb.py", line 83, in configure  
    hostname = config['musicbrainz']['host'].as_str()                                                               
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 430, in as_str   
    return self.get(String())                                                                                       
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 393, in get      
    return as_template(template).value(self, template)                                                              
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 1014, in value   
    if view.exists():                                                                                               
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 186, in exists   
    self.first()                                                                                                    
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 178, in first    
    return iter_first(pairs)                                                                                        
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 62, in iter_first
                                                                                                                    
    return next(it)                                                                                                 
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 524, in resolve  
    for collection, source in self.parent.resolve():                                                                
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 524, in resolve  
    for collection, source in self.parent.resolve():                                                                
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 950, in resolve  
    self.read()                                                                                                     
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\__init__.py", line 37, in read         
    self.set_file(filename)                                                                                         
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 887, in set_file 
    self.set(ConfigSource(load_yaml(filename), filename))                                                           
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\site-packages\beets\util\confit.py", line 121, in __init__ 
    super(ConfigSource, self).__init__(value)                                                                       
TypeError: 'NoneType' object is not iterable

I tried forcing a reinstall and got one error notification, but I don’t think/know if it’s related:
ERROR: datashader 0.7.0 has requirement testpath<0.4, but you'll have testpath 0.4.2 which is incompatible.

True! Those docs are definitely wrong. Any chance you could help us out by opening a PR to correct them or the code, or just an issue to remind us to do that?

I really don’t see where that error could be coming from! It doesn’t seem like that line of code could be producing a TypeError like that. Maybe it would be worth trying to install in a virtualenv to isolate the dependencies?

Sure I’ll have a look to try to correct the code / docs (and failing that just report the issue) :+1:

In the meantime though I created a virtual environment to test with

pip list
Package        Version
-------------- -------
beets          1.4.9
colorama       0.4.1
jellyfish      0.7.2
munkres        1.1.2
musicbrainzngs 0.6
mutagen        1.42.0
pip            19.0.3
PyYAML         5.1.2
setuptools     40.8.0
six            1.12.0
Unidecode      1.1.1
You are using pip version 19.0.3, however version 19.2.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

…but when I ran beets it still came up with the errors…

beet
Traceback (most recent call last):
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "X:\PortableApps\WinPython\python-3.7.4.amd64\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "X:\Temp\Scripts\beet.exe\__main__.py", line 9, in <module>
  File "x:\temp\lib\site-packages\beets\ui\__init__.py", line 1266, in main
    _raw_main(args)
  File "x:\temp\lib\site-packages\beets\ui\__init__.py", line 1249, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "x:\temp\lib\site-packages\beets\ui\__init__.py", line 1131, in _setup
    mb.configure()
  File "x:\temp\lib\site-packages\beets\autotag\mb.py", line 83, in configure
    hostname = config['musicbrainz']['host'].as_str()
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 430, in as_str
    return self.get(String())
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 393, in get
    return as_template(template).value(self, template)
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 1014, in value
    if view.exists():
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 186, in exists
    self.first()
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 178, in first
    return iter_first(pairs)
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 62, in iter_first
    return next(it)
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 524, in resolve
    for collection, source in self.parent.resolve():
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 524, in resolve
    for collection, source in self.parent.resolve():
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 950, in resolve
    self.read()
  File "x:\temp\lib\site-packages\beets\__init__.py", line 37, in read
    self.set_file(filename)
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 887, in set_file
    self.set(ConfigSource(load_yaml(filename), filename))
  File "x:\temp\lib\site-packages\beets\util\confit.py", line 121, in __init__
    super(ConfigSource, self).__init__(value)
TypeError: 'NoneType' object is not iterable

It might be something odd happening because of the way I have my config files set up
- I separated out the plugin configs in to a separate file for easier management (as well as the import and autotagger configs) then added those files to the include, shown below…

... \AppData\Roaming\beets
total 53K
8.0K config.yaml
1.0K config_autotagger.yaml
4.0K config_importer.yaml
4.0K config_plugins.yaml
 36K library.db

I’ll try them in one file and see if that’s what’s causing the problem

:roll_eyes: yep merging the separate config files back in to one seems to have fixed it
(…baring having forgotten to install the additional modules required by plugins I had enabled)
No errors now!

Wow; that’s weird! That import functionality might have been a mistake in the first place…