1

I've been trying to install packages on a raspberry pi 4b and I keep having issues. On the default, python ver. 3.7, I would get setup.py not found. Then I installed python ver. 3.9 and got the traceback listed below. Lastly I tried installing python ver. 3.8 and I still get the error I got using ver. 3.9. I now also get a "no module named pip" when using python3 -m pip install somePackage

The package I'm trying to install is onnx_tf.

Edit: I've tried purging and reinstalling pip but this did not work.

   Traceback (most recent call last):

  File "/usr/local/bin/pip3", line 11, in <module>

    load_entry_point('pip==20.2.4', 'console_scripts', 'pip3')()

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/main.py", line 75, in main

    return command.main(cmd_args)

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 121, in main

    return self._main(args)

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 265, in _main

    self.handle_pip_version_check(options)

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/req_command.py", line 152, in 

handle_pip_version_check

    timeout=min(5, options.timeout)

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/req_command.py", line 97, in 
_build_session

    index_urls=self._get_index_urls(options),

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/network/session.py", line 249, in __init__
    self.headers["User-Agent"] = user_agent()

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/network/session.py", line 132, in user_agent
    zip(["name", "version", "id"], distro.linux_distribution()),

  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 125, in linux_distribution
    return _distro.linux_distribution(full_distribution_name)

  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 681, in linux_distribution
    self.version(),

  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 741, in version
    self.lsb_release_attr('release'),

  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 903, in lsb_release_attr
    return self._lsb_release_info.get(attribute, '')

  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 556, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)

  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/distro.py", line 1014, in _lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)

  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1

pi@raspberrypi:~ $ python3 -m pip install onnx_tf

/usr/bin/python3: No module named pip
4
  • 3
    I think you are pretty much on your own once you start to download packages almost at random. I suggest you get back to a default Raspbian install and then ask again. Your issue seems to start with the mistaken belief that a "setup.py" must exist. – joan Oct 30 '20 at 19:03
  • 1
    I see, that's unfortunate – colonelgdr Oct 30 '20 at 19:07
  • 1
    Have you installed pip? sudo apt install python3-pip – Mats Karlsson Oct 30 '20 at 19:16
  • 1
    Yes, I have tried that. – colonelgdr Oct 30 '20 at 19:22
1

What do you mean setup.py not found? What were you trying to do?

Installing different python versions is not advised unless you really know what you're doing.

If you're on the desktop image, you have pip3. If you're on the lite image, run sudo apt install python3-pip and then you have everything you need.

3
  • 1
    I get this now using ver. 3.7: pastebin.com/UcfDtAY9 It's different but can I fix this? – colonelgdr Oct 30 '20 at 19:22
  • 2
    Your pip3 is pointed at python 2. You need to start again with a fresh image. – ben_nuttall Oct 30 '20 at 23:05
  • thanks, i will do this – colonelgdr Oct 31 '20 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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