Bitcoin Forum
May 03, 2024, 06:24:25 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: python installation glitch  (Read 221 times)
Millionero (OP)
Sr. Member
****
Offline Offline

Activity: 807
Merit: 423


View Profile
December 08, 2019, 03:10:47 AM
 #1

Problems with python preventing electrum installation
Code:
a@galliumos:~$ python3 -m pip install --user Electrum-3.3.8.tar.gz[fast]
Processing ./Electrum-3.3.8.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-es9f4rc7/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-es9f4rc7/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-es9f4rc7/pip-egg-info
         cwd: /tmp/pip-req-build-es9f4rc7/
    Complete output (1 lines):
    Error: Electrum requires Python version >= 3.6.1...
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
a@galliumos:~$ sudo apt install python3.8
Reading package lists... Done
Building dependency tree      
Reading state information... Done
python3.8 is already the newest version (3.8.0-1+xenial2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
a@galliumos:~$ python3 --version
Python 3.5.2
python3.8 is apparently installed but the computer is showing that Python is still version 3.5.2
Running the install command again, it gives the same error.
I'm afraid to remove python3.5 because
Code:
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  galliumos-base ubuntu-standard (due to galliumos-base)
0 upgraded, 4 newly installed, 105 to remove and 0 not upgraded.
Need to get 1.485 kB/1.650 kB of archives.
After this operation, 595 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?]
Help, suggestions?
1714760665
Hero Member
*
Offline Offline

Posts: 1714760665

View Profile Personal Message (Offline)

Ignore
1714760665
Reply with quote  #2

1714760665
Report to moderator
"The nature of Bitcoin is such that once version 0.1 was released, the core design was set in stone for the rest of its lifetime." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714760665
Hero Member
*
Offline Offline

Posts: 1714760665

View Profile Personal Message (Offline)

Ignore
1714760665
Reply with quote  #2

1714760665
Report to moderator
1714760665
Hero Member
*
Offline Offline

Posts: 1714760665

View Profile Personal Message (Offline)

Ignore
1714760665
Reply with quote  #2

1714760665
Report to moderator
1714760665
Hero Member
*
Offline Offline

Posts: 1714760665

View Profile Personal Message (Offline)

Ignore
1714760665
Reply with quote  #2

1714760665
Report to moderator
AltcoinBuilder
Copper Member
Jr. Member
*
Offline Offline

Activity: 85
Merit: 5


View Profile WWW
December 08, 2019, 02:09:32 PM
 #2

try:
Quote

To change Python 3.6.8 as the default in Ubuntu 18.04 to Python 3.7.

Install Python 3.7

Steps to install Python3.7 and configure it as the default interpreter.

    Install the python3.7 package using apt-get

    sudo apt-get install python3.7

    Add Python3.6 & Python 3.7 to update-alternatives

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2

    Update Python 3 to point to Python 3.7

    sudo update-alternatives --config python3 Enter 2 for Python 3.7

    Test the version of python

python3 --v
Python 3.7.1


resource: https://stackoverflow.com/questions/41986507/unable-to-set-default-python-version-to-python3-in-ubuntu

or this one:
Quote
From the comment:

sudo update-alternatives --config python

Will show you an error:

update-alternatives: error: no alternatives for python3

You need to update your update-alternatives , then you will be able to set your default python version.

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2

Then run :

sudo update-alternatives --config python

Set python3.8 as default.

Or use the following command to set python3.8 as default:

sudo update-alternatives  --set python /usr/bin/python3.8


resource: https://unix.stackexchange.com/questions/410579/change-the-python3-default-version-in-ubuntu
Millionero (OP)
Sr. Member
****
Offline Offline

Activity: 807
Merit: 423


View Profile
December 09, 2019, 03:24:28 AM
 #3

Usually command update-alternatives solve the problem, but you also could try use command python3.8 rather than python3 to make sure you use Python 3.8

Code:
python3.8 --version
python3.8 -m pip install --user Electrum-3.3.8.tar.gz[fast]
Thanks for the response.
First I had
Code:
ImportError: No module named pip
so I ran
Code:
sudo apt-get install python3-pip
and
Code:
a@galliumos:~$ python3.8 --version
Python 3.8.0
a@galliumos:~$ python3.8 -m pip install --user Electrum-3.3.8.tar.gz[fast]
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.8/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.8/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 14, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 23, in <module>
    from pip.locations import (
  File "/usr/lib/python3/dist-packages/pip/locations.py", line 9, in <module>
    from distutils import sysconfig
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py)
I've been using linux for years but at this stuff I'm still a noob.
Since I'm at a dead end for ETFbitcoin's suggestions, I'll try AltcoinBuilder's idea when I have the time.  Will report back.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
December 09, 2019, 11:12:09 AM
 #4

Is python not backwards compatible? I thought it would be since all the old modules are the same without them making a python 4 (they just change system libraries and compilation stuff).

And yeah it looks just like you need pip install distutils.

@Millionero, when you want to read python errors. Look for the bottom line first (traceback most recent call last) is given to say the error is generally on the last line and moving up but the other lines are a call stack...
Millionero (OP)
Sr. Member
****
Offline Offline

Activity: 807
Merit: 423


View Profile
December 09, 2019, 01:04:17 PM
 #5

I just posted a response about all the errors I'm getting but the response was so long that it got cut off.
Python is broken beyond repair.
I can either use the Electrum appimage, or reinstall my OS and start fresh with Python.
I'm going to have to reinstall the OS anyway because grub is broken and I can't repair it either.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
December 10, 2019, 05:13:03 AM
 #6

Is python not backwards compatible? I thought it would be since all the old modules are the same without them making a python 4 (they just change system libraries and compilation stuff).
Python has a lot of versioning issues... look at all the "Python 2" vs "Python 3" issues... but then 3 was intentionally not backwards compatible.

This article explains the new features in Python 3.0, compared to 2.6. Python 3.0, also known as “Python 3000” or “Py3K”, is the first ever intentionally backwards incompatible Python release. There are more changes than in a typical release, and more that are important for all Python users. Nevertheless, after digesting the changes, you’ll find that Python really hasn’t changed all that much – by and large, we’re mostly fixing well-known annoyances and warts, and removing a lot of old cruft.

Also, various linux distros all use different "default" versions... which can and do cause problems for users when they are attempting to use various apps that rely on specific versions. There are very good reasons why the Electrum devs put out the "AppImage" Tongue Roll Eyes

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
IeSua
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 869


View Profile
December 10, 2019, 09:59:28 PM
Merited by HCP (2)
 #7

@Millionero, the fact that you have installed python versions 3.8 or 3.5.2 does not mean that your system uses it by default.


Please write the answers to all these commands:

Code:
python -V

Code:
python3 -V

Code:
python3.8 --version

Code:
ls /usr/bin/python2*

Code:
ls /usr/bin/python3*
Millionero (OP)
Sr. Member
****
Offline Offline

Activity: 807
Merit: 423


View Profile
December 11, 2019, 12:57:26 AM
 #8


Please write the answers to all these commands:


Here you go

Code:
a@galliumos:~$ python -V
Python 3.7.5
a@galliumos:~$ python3 -V
Python 3.6.9
a@galliumos:~$ python3.8 --version
Python 3.8.0
a@galliumos:~$ ls /usr/bin/python2*
ls: cannot access '/usr/bin/python2*': No such file or directory
a@galliumos:~$ ls /usr/bin/python3*
/usr/bin/python3           /usr/bin/python3.5-dbg-config  /usr/bin/python3.5m-config  /usr/bin/python3.7m      /usr/bin/python3m-config
/usr/bin/python3.5         /usr/bin/python3.5dm           /usr/bin/python3.6          /usr/bin/python3.8
/usr/bin/python3.5-config  /usr/bin/python3.5dm-config    /usr/bin/python3.6m         /usr/bin/python3-config
/usr/bin/python3.5-dbg     /usr/bin/python3.5m            /usr/bin/python3.7          /usr/bin/python3m
a@galliumos:~$
IeSua
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 869


View Profile
December 11, 2019, 03:08:20 AM
Merited by HCP (2), ABCbits (1)
 #9


Please write the answers to all these commands:


Here you go

~

You have 4 versions of Python (default version is 3.7.5).

Code:
sudo apt install python3-pyqt5
Code:
wget https://download.electrum.org/3.3.8/Electrum-3.3.8.tar.gz
Code:
sudo apt install python3-setuptools python3-pip
Code:
sudo pip3 install Electrum-3.3.8.tar.gz
Code:
electrum

And everything should work.

-----

If not, you can try changing the default python version and try again:

// this will change to version 3.6.9
Code:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2

// this will change to version 3.8.0
Code:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!