Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Raspberry - Python 3.7 - Installation trouble
#1
Hi,

I installes Python 3.7 on my Raspberry Pi 3 Model B.
I used those sites:
https://gist.github.com/SeppPenner/6a5a3...524417761d
https://www.ramoonus.nl/2018/06/30/insta...pberry-pi/
https://installvirtual.com/install-pytho...pberry-pi/
https://forums.sickrage.ca/t/how-to-migr...hon-3/1365

Once installed I have many troubles using pip.

Here the error:

pi@RaspberryMadjo:~/Downloads/Python-3.7.0 $ python3 -m pip install --user --upgrade pip
Exception:
Traceback (most recent call last):
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/basecommand.py", line 228, in main
status = self.run(options, args)
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 241, in run
with self._build_session(options) as session:
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/basecommand.py", line 81, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/download.py", line 338, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/download.py", line 101, in user_agent
zip(["name", "version", "id"], distro.linux_distribution()),
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 120, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 634, in linux_distribution
self.version(),
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 688, in version
self.lsb_release_attr('release'),
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 836, in lsb_release_attr
return self._lsb_release_info.get(attribute, '')
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 522, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 933, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File "/usr/local/opt/python-3.7.0/lib/python3.7/subprocess.py", line 376, in check_output
**kwargs).stdout
File "/usr/local/opt/python-3.7.0/lib/python3.7/subprocess.py", line 468, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
Traceback (most recent call last):
File "/usr/local/opt/python-3.7.0/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/opt/python-3.7.0/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/__main__.py", line 19, in <module>
sys.exit(_main())
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/__init__.py", line 246, in main
return command.main(cmd_args)
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/basecommand.py", line 264, in main
timeout=min(5, options.timeout)) as session:
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/basecommand.py", line 81, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/download.py", line 338, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_internal/download.py", line 101, in user_agent
zip(["name", "version", "id"], distro.linux_distribution()),
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 120, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 634, in linux_distribution
self.version(),
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 688, in version
self.lsb_release_attr('release'),
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 836, in lsb_release_attr
return self._lsb_release_info.get(attribute, '')
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 522, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File "/usr/local/opt/python-3.7.0/lib/python3.7/site-packages/pip/_vendor/distro.py", line 933, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File "/usr/local/opt/python-3.7.0/lib/python3.7/subprocess.py", line 376, in check_output
**kwargs).stdout
File "/usr/local/opt/python-3.7.0/lib/python3.7/subprocess.py", line 468, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.


Coul someone help me to understand what's hapenning ?

Thanks.
Quote
#2
Did you remove python2?
what output are you getting in terminal:
pip --version
pip3 --version
found solution :here
Quote
#3
The lsb_release uses on Ubuntu Python 3. On Raspbian I guess Python 2.7.
If you change system wide the interpreter to python3 as symlink to python, you'll
run into many issues. Some OS-tools still require Python 2.7.
I guess with the next release of Raspbian they would change many tools to use Python 3 as standard.

I hope that 2020 this problem is defused.

A better approach is a user-instalation of Python. I use always pyenv on Rapsberry Pi, but compiling everything takes time.

Another good news for you: https://blog.piwheels.org/raspberry-pi-4...an-buster/
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  A question about python in Raspberry Psycopast 3 77 Aug-14-2019, 06:36 PM
Last Post: buran
  Trouble processing file villumanati 1 74 Jul-30-2019, 04:17 AM
Last Post: Larz60+
  Trouble importing modules on a new python version snackman_barry 2 145 Jul-12-2019, 11:15 AM
Last Post: snackman_barry
  More Python Embedding Trouble jibarra 3 172 Jul-11-2019, 09:25 PM
Last Post: Gribouillis
  installation directory of modules in python3.7 srm 2 169 Jul-11-2019, 01:06 PM
Last Post: joe_momma
  Trying to get a coherent python installation Reverend_Jim 2 290 Jun-19-2019, 09:56 PM
Last Post: Reverend_Jim
  Installation Marsu_06 4 328 Jun-07-2019, 10:56 PM
Last Post: Marsu_06
  trouble with os.listdir on a network drive lconner 10 468 Jun-04-2019, 07:16 PM
Last Post: DeaD_EyE
  Raspberry pi simpel coding mike3001 2 204 May-22-2019, 03:38 PM
Last Post: mike3001
  Install Python on Raspberry Pi 3 B+ loren41 4 510 May-03-2019, 03:13 PM
Last Post: loren41

Forum Jump:


Users browsing this thread: 1 Guest(s)