TypeError: expected string or bytes-like object, got 'NoneType' when running setup.py in picar-x

Tried to install picar-x with the following according to https://docs.sunfounder.com/projects/picar-x-v20/en/latest/python/python_start/install_all_modules.html:
cd ~/
git clone -b v2.0 GitHub - sunfounder/picar-x
cd picar-x
sudo python3 setup.py install

Received the following errors:
Traceback (most recent call last):
File “/home/username/picar-x/setup.py”, line 17, in
setup(
File “/usr/lib/python3/dist-packages/setuptools/init.py”, line 107, in setup
_install_setup_requires(attrs)
File “/usr/lib/python3/dist-packages/setuptools/init.py”, line 75, in _install_setup_requires
dist = MinimalDistribution(attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/setuptools/init.py”, line 57, in init
super().init(filtered)
File “/usr/lib/python3/dist-packages/setuptools/dist.py”, line 473, in init
for ep in metadata.entry_points(group=‘distutils.setup_keywords’):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/importlib/metadata/init.py”, line 1040, in entry_points
return SelectableGroups.load(eps).select(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/importlib/metadata/init.py”, line 476, in load
ordered = sorted(eps, key=by_group)
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/importlib/metadata/init.py”, line 1037, in
eps = itertools.chain.from_iterable(
^
File “/usr/lib/python3.11/importlib/metadata/_itertools.py”, line 16, in unique_everseen
k = key(element)
^^^^^^^^^^^^
File “/usr/lib/python3.11/importlib/metadata/init.py”, line 954, in _normalized_name
or super().normalized_name
^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/importlib/metadata/init.py”, line 627, in normalized_name
return Prepared.normalize(self.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/importlib/metadata/init.py”, line 882, in normalize
return re.sub(r"[-
.]+", “-”, name).lower().replace(‘-’, '
')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/re/init.py”, line 185, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got ‘NoneType’

I am using Raspberry Pi 4 with the following OS:
Linux raspberrypi 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

I was unsure if the issue was related to python version, so I tried using python3.10.14 (installed via Pyenv) but the same issue persisted. For some reason, some of the functions in setuptools still continued using the system’s python (3.11) despite the python version set to 3.10.14 with pyenv.

Any idea how to solve this issue?

  1. We recommend that you provide us with the version of the system you are using so that we can reproduce the problem.
    You are not sure which version of Raspberry Pi you are using by providing the information.
  2. Or you can reinstall a new system and install all the library code to see how it works.
  3. Did you get any errors when installing robot-hat, vilib libraries.

Thanks. Issue has been fixed after installing the Raspberry Pi 4 32-bit OS

1 Like