# ValueError: Name node can't be used with 'None' constant

**URL:** <https://discourse.beets.io/t/valueerror-name-node-cant-be-used-with-none-constant/1411>\
**Category:** Help\
**Created:** [July 18, 2020, 9:59am UTC](https://discourse.beets.io/t/valueerror-name-node-cant-be-used-with-none-constant/1411 "2020-07-18T09:59:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdbruin](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kdbruin](https://discourse.beets.io/u/kdbruin)\
**Post date:** [July 18, 2020, 9:59am UTC](https://discourse.beets.io/t/valueerror-name-node-cant-be-used-with-none-constant/1411/1 "2020-07-18T09:59:34Z")

</div>

I’m running beets on my iMac since some times now and now I’m getting the following error when running beets (even `beet version`):

```
ValueError: Name node can't be used with 'None' constant

```

This is using Homebrew, python@3.8 and the latest beets installed via pip3. Other python packages are all up to date. The list of installed packages:

```
autopep8 1.5.3
beets 1.4.9
certifi 2020.6.20
chardet 3.0.4
discogs-client 2.3.0
entrypoints 0.3
flake8 3.8.3
idna 2.10
jellyfish 0.8.2
lxml 4.5.2
mccabe 0.6.1
munkres 1.1.2
musicbrainzngs 0.7.1
mutagen 1.45.0
oauthlib 3.1.0
peewee 3.13.3
pip 20.1.1
pony 0.7.13
pycairo 1.19.1
pycodestyle 2.6.0
pyflakes 2.2.0
PyGObject 3.36.1
pymediainfo 4.2.1
python-slugify 4.0.1
PyYAML 5.3.1
requests 2.24.0
rope 0.17.0
setuptools 49.2.0
six 1.15.0
text-unidecode 1.3
toml 0.10.1
Unidecode 1.1.1
urllib3 1.25.9
wheel 0.34.2

```

Any ideas what can cause the issue. The complete trace is

```
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/beets/ui/ __init__.py", line 1266, in main
    _raw_main(args)
  File "/usr/local/lib/python3.8/site-packages/beets/ui/ __init__.py", line 1249, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "/usr/local/lib/python3.8/site-packages/beets/ui/ __init__.py", line 1144, in _setup
    lib = _open_library(config)
  File "/usr/local/lib/python3.8/site-packages/beets/ui/ __init__.py", line 1201, in _open_library
    get_path_formats(),
  File "/usr/local/lib/python3.8/site-packages/beets/ui/ __init__.py", line 619, in get_path_formats
    path_formats.append((query, template(view.as_str())))
  File "/usr/local/lib/python3.8/site-packages/beets/util/functemplate.py", line 571, in template
    return Template(fmt)
  File "/usr/local/lib/python3.8/site-packages/beets/util/functemplate.py", line 581, in __init__
    self.compiled = self.translate()
  File "/usr/local/lib/python3.8/site-packages/beets/util/functemplate.py", line 614, in translate
    func = compile_func(
  File "/usr/local/lib/python3.8/site-packages/beets/util/functemplate.py", line 155, in compile_func
    prog = compile(mod, '<generated>', 'exec')
ValueError: Name node can't be used with 'None' constant
```

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [July 18, 2020, 12:01pm UTC](https://discourse.beets.io/t/valueerror-name-node-cant-be-used-with-none-constant/1411/2 "2020-07-18T12:01:39Z")

</div>

Hello! The issue template on GitHub has instructions for what we need to help with crashes:

> **[Build software better, together](https://github.com/beetbox/beets/issues/new?template=bug-report.md)**
>
> GitHub is where people build software. More than 50 million people use GitHub to discover, fork, and contribute to over 100 million projects.

Namely, we can’t really say much without seeing your config.

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [July 18, 2020, 12:02pm UTC](https://discourse.beets.io/t/valueerror-name-node-cant-be-used-with-none-constant/1411/3 "2020-07-18T12:02:44Z")

</div>

One guess, however, is that you’re running into this issue:

> <https://github.com/beetbox/beets/pull/3621>

---

<div class="post-metadata">

**Author:** ![kdbruin](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kdbruin](https://discourse.beets.io/u/kdbruin)\
**Post date:** [July 18, 2020, 12:15pm UTC](https://discourse.beets.io/t/valueerror-name-node-cant-be-used-with-none-constant/1411/4 "2020-07-18T12:15:01Z")

</div>

Looking at this I think you’re right. I will revert some things back to previous versions and watch for ast related changes before I upgrade things again.
