Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing Python 3.7.0 on Raspbian

Installing Python 3.7.0 on Raspbian

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.0 This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).

    sudo apt-get update -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y

    If one of the packages cannot be found, try a newer version number (e.g. libdb5.4-dev instead of libdb5.3-dev).

  2. Download and install Python 3.7.0 When downloading the source code, select the most recent release of Python 3.7.0, available on the official site. Adjust the file names accordingly.

    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
    tar xf Python-3.7.0.tar.xz
    cd Python-3.7.0
    ./configure
    make -j 4
    sudo make altinstall
  3. Optionally: Delete the source code and uninstall the previously installed packages. When uninstalling the packages, make sure you only remove those that were not previously installed on your system. Also, remember to adjust version numbers if necesarry.

    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
    sudo apt-get --purge remove build-essential tk-dev -y
    sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev -y
    sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev -y
    sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    sudo apt-get autoremove -y
    sudo apt-get clean

or simply copy the setup.sh content to a file called setup.sh, do a chmod +x setup.sh and execute the script via sudo ./setup.sh

Afterwards, use the python setup by calling

python3.7 yourscript.py.

to get the correct python version running.

This guide is pretty much taken from the following tutorial: https://liudr.wordpress.com/2016/02/04/install-python-on-raspberry-pi-or-debian/ and https://gist.github.com/BMeu/af107b1f3d7cf1a2507c9c6429367a3b

sudo apt-get update -y
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xf Python-3.7.0.tar.xz
cd Python-3.7.0
./configure
make -j 4
sudo make altinstall
cd ..
sudo rm -r Python-3.7.0
rm Python-3.7.0.tar.xz
sudo apt-get --purge remove build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
sudo apt-get autoremove -y
sudo apt-get clean
@profmatheus

This comment has been minimized.

Copy link

commented Jul 31, 2018

Thanks a lot!

@heyalexchoi

This comment has been minimized.

Copy link

commented Aug 9, 2018

@SeppPenner are you able to use python 3.7's pip?

pi@raspberrypi:~/homebot $ python3.7 -m pip
/usr/local/bin/python3.7: No module named pip
pi@raspberrypi:~/homebot $ pip3.7
-bash: pip3.7: command not found
pi@raspberrypi:~/homebot $ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)
@PhillipNewman

This comment has been minimized.

Copy link

commented Aug 14, 2018

How do you install the Python 3.7 IDLE and it's shortcut to the menu>Programming where I currently have:
Python 2 (IDLE)
Python 3 (IDLE)
Python 3.7 (IDLE) <-- this is what I want.

@dalymople

This comment has been minimized.

Copy link

commented Sep 18, 2018

I am having an error with this script and SSL support.
The end result is that the _sll module is not built and pip fails to download anything because of this...

After a bit of digging I have found that after calling ./configure;

checking whether compiling and linking against OpenSSL works... yes
checking for X509_VERIFY_PARAM_set1_host in libssl... no
checking for --with-ssl-default-suites... python

This leads to the following build error;

Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381

So it looks like the libssl-dev dependency may not be correct?

@MEHUL95

This comment has been minimized.

Copy link

commented Oct 6, 2018

I am getting error while executing the command:
pi@raspberrypi:/etc/apt/sources.list.d/Python-3.7.0 $ make -j 4

error:
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/Python-ast.o Python/Python-ast.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/asdl.o Python/asdl.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/ast.o Python/ast.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/ast_opt.o Python/ast_opt.c
Assembler messages:
Fatal error: can't create Python/asdl.o: Permission denied
Makefile:1623: recipe for target 'Python/asdl.o' failed
make: *** [Python/asdl.o] Error 1
make: *** Waiting for unfinished jobs....
Assembler messages:
Fatal error: can't create Python/ast_opt.o: Permission denied
Makefile:1623: recipe for target 'Python/ast_opt.o' failed
make: *** [Python/ast_opt.o] Error 1
Assembler messages:
Fatal error: can't create Python/ast.o: Permission denied
Makefile:1623: recipe for target 'Python/ast.o' failed
make: *** [Python/ast.o] Error 1
Assembler messages:
Fatal error: can't create Python/Python-ast.o: Permission denied
Makefile:1623: recipe for target 'Python/Python-ast.o' failed
make: *** [Python/Python-ast.o] Error 1

I am novice to raspbian platform please help.

@BombshellBill

This comment has been minimized.

Copy link

commented Oct 11, 2018

just writing to say thanks for putting this together

@drinu276

This comment has been minimized.

Copy link

commented Oct 26, 2018

Thanks for this, running the setup.sh script worked great! No issues.

@skyice78

This comment has been minimized.

Copy link

commented Dec 3, 2018

Why use altinstall?

@peerv

This comment has been minimized.

Copy link

commented Dec 20, 2018

Thanks, did run the script and after 30 minutes all was up and running python 3.7

@yackx

This comment has been minimized.

Copy link

commented Jan 4, 2019

@skyice78 see here about altinstall

@ianschafer

This comment has been minimized.

Copy link

commented Jan 8, 2019

Installing Python-3.7.2 worked for me on RaspberryPi 3B+ running Raspbian.
I ran the ./configure a second time for stable optimizations (It gives you the choice).
The line: make -j 4 took very long at 2hr56min.
The line: sudo make altinstall took just a few minutes.
In the end ... success! Thanks!

@jagrit007

This comment has been minimized.

Copy link

commented Jan 19, 2019

Ok so Everything ran just fine. altinstall worked just fine but after all that when I checked my python version ("python3 --version") , It was still the older one i.e 3.5.2
So my question here is, Do I have to remove previous python installation that came by default?
Or it there something else I can do?

@marked23

This comment has been minimized.

Copy link

commented Jan 20, 2019

@ianschafer I looked up -j 4 and also -l 4 (that's a lower case L). GNU make
-j (aka. --jobs) takes an integer to specify how many recipes to run in parallel. (or empty to mean, max-it-out.)
-l (aka. --max-load) takes a float to specify the load level where it should hold-back adding more parallel recipes.
Used together, as in "make --jobs --max-load 4", seems like it should dynamically regulate parallel make jobs to keep the average load around X. (I'm not sure what "load" means.)

That being said... your 2hr 56min beat my time of 4+ hours. So I probably need to experiment with the "4" value that I used yesterday.

@marked23

This comment has been minimized.

Copy link

commented Jan 21, 2019

@jagrit007 I have a similar question, but I've discovered most of the answer.

For this I'm reasonably confident:
Raspbian depends on 2.7 and 3.5, as part of the OS dependencies. You don't want to change them, or re-purpose the symbolic links that reference them. Installing 3.7 means that you will have a third version of Python on your machine. This is the best-practice.

Can someone validate what I'm saying here?
I want to install Python 3.7, for use by any/all users, without making them customize their .bashrc, or install to /home/<user>/.local/.

I'm using this configure:: ./configure --enable-optimizations --prefix=/usr/local/

I want it to work in such a way that any user can shebang python 3.7: #!/usr/bin/env python3.7
and confirm their python version: $ /usr/bin/env python3.7 -V
and run python 3.7 interactively without specifying the full path to env: $ python3.7 -V

I think merely setting that --prefix=/usr/local/ does the deed. Am I missing some other necessity?

@floflo2607

This comment has been minimized.

Copy link

commented Jan 27, 2019

1 line
sudo apt-get update -y && sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y && wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz && tar xf Python-3.7.0.tar.xz && cd Python-3.7.0 && ./configure && make -j 4 && sudo make altinstall && cd .. && sudo rm -r Python-3.7.0 && rm Python-3.7.0.tar.xz && sudo apt-get --purge remove build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y && sudo apt-get autoremove -y && sudo apt-get clean

@kidig

This comment has been minimized.

Copy link

commented Feb 25, 2019

thank you!

@vinceskahan

This comment has been minimized.

Copy link

commented Mar 10, 2019

yes, @floflo2607's instructions worked fine on a pi3b+ (I skipped the cleanup half after 'make altinstall'). Thanks here too !

@wordlesswind

This comment has been minimized.

@Flightkick

This comment has been minimized.

Copy link

commented Apr 2, 2019

To also enable PGO, use ./configure --enable-optimizations instead of ./configure (Stack Overflow: what does --enable-optimizations do while compiling python?)

You will also need uuid-dev or make will report:
The necessary bits to build these optional modules were not found: _uuid

So use:
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev uuid-dev -y

@BryanHitchcock

This comment has been minimized.

Copy link

commented Apr 10, 2019

Thank you, this is extremely useful!

@Flightkick thanks for the heads up about optimizations as well!

@Hongbo-Miao

This comment has been minimized.

Copy link

commented Apr 17, 2019

Thanks! Succeed for installing Python 3.7.3 on Raspberry Pi 3 Model B+.

For future readers, after that just use python3.7 and pip3.7, for example

python3.7 --verison
pip3.7 --verison
@chmedly

This comment has been minimized.

Copy link

commented Apr 18, 2019

I tried @floflo2607's one liner and got an error near the end (something about a null where it didn't belong) and then I reran it replacing all the 3.7.0 stuff with 3.7.2 and it ran without error. Sorry I didn't take more careful notes about what wasn't happy the first time.

@floflo2607

This comment has been minimized.

Copy link

commented Apr 18, 2019

@chmedly some libs can have change

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

@SeppPenner are you able to use python 3.7's pip?

@heyalexchoi: Yes, I am:

root@raspberrypi:/home/pi# python3.7 -m pip

Usage:
  /usr/local/bin/python3.7 -m pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring
                              environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be
                              used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be
                              used up to 3 times (corresponding to WARNING,
                              ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form
                              [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should
                              attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists:
                              (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort).
  --trusted-host <hostname>   Mark this host as trusted, even though it does
                              not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file
                              containing the private key and the certificate
                              in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine
                              whether a new version of pip is available for
                              download. Implied with --no-index.
  --no-color                  Suppress colored output
@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

@SeppPenner are you able to use python 3.7's pip?

@heyalexchoi: Yes, I am:

root@raspberrypi:/home/pi# python3.7 -m pip

Usage:
  /usr/local/bin/python3.7 -m pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring
                              environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be
                              used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be
                              used up to 3 times (corresponding to WARNING,
                              ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form
                              [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should
                              attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists:
                              (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort).
  --trusted-host <hostname>   Mark this host as trusted, even though it does
                              not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file
                              containing the private key and the certificate
                              in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine
                              whether a new version of pip is available for
                              download. Implied with --no-index.
  --no-color                  Suppress colored output
@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

How do you install the Python 3.7 IDLE and it's shortcut to the menu>Programming where I currently have:
Python 2 (IDLE)
Python 3 (IDLE)
Python 3.7 (IDLE) <-- this is what I want.

@PhillipNewman: I have no idea to be honest.

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

How do you install the Python 3.7 IDLE and it's shortcut to the menu>Programming where I currently have:
Python 2 (IDLE)
Python 3 (IDLE)
Python 3.7 (IDLE) <-- this is what I want.

@PhillipNewman: I have no idea to be honest.

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

@dalymople and @MEHUL95: I'm sorry, I cannot help you on that issues...

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

@dalymople and @MEHUL95: I'm sorry, I cannot help you on that issues...

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

Why use altinstall?

@skyice78: WHy not?

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

Why use altinstall?

@skyice78: WHy not?

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

@peerv and @ianschafer: Yeah, the make process takes very long (The make -j 4 runs the build on 4 threads, I'm not sure if this is a good idea. However, make alone takes even longer)

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

Ok so Everything ran just fine. altinstall worked just fine but after all that when I checked my python version ("python3 --version") , It was still the older one i.e 3.5.2
So my question here is, Do I have to remove previous python installation that came by default?
Or it there something else I can do?

@jagrit007: You need to use python3.7 --version, the regular python3 --version is your package installed from apt or whatever package manager you are using.

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Apr 28, 2019

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented May 1, 2019

@irishgeoffrey: What do you want to tell us? This is an advertisement only and therefore, I will delete it.

@Norbinsh

This comment has been minimized.

Copy link

commented May 17, 2019

Thanks! Succeed for installing Python 3.7.3 on Raspberry Pi 3 Model B+.

For future readers, after that just use python3.7 and pip3.7, for example

python3.7 --verison
pip3.7 --verison

Confirming this worked smoothly on RPI2 with Python 3.7.3:

sudo apt-get update -y && sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y && wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz && tar xf Python-3.7.3.tar.xz && cd Python-3.7.3 && ./configure && make -j 4 && sudo make altinstall && cd .. && sudo rm -r Python-3.7.3 && rm Python-3.7.3.tar.xz && sudo apt-get --purge remove build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y && sudo apt-get autoremove -y && sudo apt-get clean

enter repl with:

python3.7

@Avaray

This comment has been minimized.

Copy link

commented May 19, 2019

This script works great on 3b+. Entire process took about 20-30 minutes.

@Minecraftschurli

This comment has been minimized.

Copy link

commented Jun 4, 2019

this doesn't work for me
Using: Raspberry Pi 3B+ and freshly installed raspbian stretch
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking for python3.7... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in '/home/pi/Python-3.7.3':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use '--host'.
See 'config.log' for more details

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Jun 4, 2019

configure: error: cannot run C compiled programs.

Sorry, I have no idea here...

@Bluscream

This comment has been minimized.

Copy link

commented Jun 5, 2019

blu@minopia:~/bots/discord/Discord-MessageLinkToQuoteBot$ python3.7 --version
Python 3.7.0
blu@minopia:~/bots/discord/Discord-MessageLinkToQuoteBot$ python3.7 -m pip
/usr/local/bin/python3.7: No module named pip
blu@minopia:/tmp$ python3.7 get-pip.py
Traceback (most recent call last):
  File "get-pip.py", line 21492, in <module>
    main()
  File "get-pip.py", line 197, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip._internal
  File "/tmp/tmpjg28ooc4/pip.zip/pip/_internal/__init__.py", line 40, in <module>
  File "/tmp/tmpjg28ooc4/pip.zip/pip/_internal/cli/autocompletion.py", line 8, in <module>
  File "/tmp/tmpjg28ooc4/pip.zip/pip/_internal/cli/main_parser.py", line 12, in <module>
  File "/tmp/tmpjg28ooc4/pip.zip/pip/_internal/commands/__init__.py", line 6, in <module>
  File "/tmp/tmpjg28ooc4/pip.zip/pip/_internal/commands/completion.py", line 6, in <module>
  File "/tmp/tmpjg28ooc4/pip.zip/pip/_internal/cli/base_command.py", line 20, in <module>
  File "/tmp/tmpjg28ooc4/pip.zip/pip/_internal/download.py", line 37, in <module>
  File "/tmp/tmpjg28ooc4/pip.zip/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/usr/local/lib/python3.7/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
@imaginaryeast

This comment has been minimized.

Copy link

commented Jun 5, 2019

Looks like raspbian no longer has a libreadline6-dev, it automatically defaults to some generic libreadline-dev. I assume it's fine as it installs, but perhaps the documentation should be fixed?

@imaginaryeast

This comment has been minimized.

Copy link

commented Jun 5, 2019

When I input python3.7 yourscript.py, I get "python3.7 can't open file 'yourscript.py': [Errno 2] No such file or directory

@Piprogrammer5

This comment has been minimized.

Copy link

commented Jun 5, 2019

@PhillipNewman

How do you install the Python 3.7 IDLE and it's shortcut to the menu>Programming where I currently have:
Python 2 (IDLE)
Python 3 (IDLE)
Python 3.7 (IDLE) <-- this is what I want.

use alacarte to change idle's command. go to programming, find the checked idle3 and in properties change the command.
change it from /usr/bin/idle3 to /usr/local/bin/idle3.7

@Paitch

This comment has been minimized.

Copy link

commented Jun 11, 2019

This script works on Raspberry Pi Zero W, with about 1h30 installation time.
No problem at all.
Thanks for sharing!

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Jun 12, 2019

This script works on Raspberry Pi Zero W, with about 1h30 installation time.

The installation time is really bad, I know...

@Paitch

This comment has been minimized.

Copy link

commented Jun 12, 2019

This script works on Raspberry Pi Zero W, with about 1h30 installation time.

The installation time is really bad, I know...

Don´t worry about that.. @SeppPenner! It´s not your fault with they didn´t put 2GB ram on Pi Zero..
At least your script works and make things really easy! Kudos!

@im-alexandre

This comment has been minimized.

Copy link

commented Jul 5, 2019

Thanks! Succeed for installing Python 3.7.3 on Raspberry Pi 3 Model B+.

For future readers, after that just use python3.7 and pip3.7, for example

python3.7 --verison
pip3.7 --verison

Man, you've just saved my life!!!!

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Jul 10, 2019

Thanks! Succeed for installing Python 3.7.3 on Raspberry Pi 3 Model B+.
For future readers, after that just use python3.7 and pip3.7, for example

python3.7 --verison
pip3.7 --verison

Man, you've just saved my life!!!!

Just make sure to use --version, not --verison.

@guti7

This comment has been minimized.

Copy link

commented Jul 14, 2019

When I input python3.7 yourscript.py, I get "python3.7 can't open file 'yourscript.py': [Errno 2] No such file or directory

@imaginaryeast change the name yourscript.py to match the name of your script you are trying to run.

@guti7

This comment has been minimized.

Copy link

commented Jul 14, 2019

@PhillipNewman

How do you install the Python 3.7 IDLE and it's shortcut to the menu>Programming where I currently have:
Python 2 (IDLE)
Python 3 (IDLE)
Python 3.7 (IDLE) <-- this is what I want.

use alacarte to change idle's command. go to programming, find the checked idle3 and in properties change the command.
change it from /usr/bin/idle3 to /usr/local/bin/idle3.7

@Piprogramer5 Thanks!

@runninbear5

This comment has been minimized.

Copy link

commented Jul 28, 2019

@SeppPenner I followed your link and the installation seemed to work great. However pip3.7 does not work for me, it is an unrecognized command. I downloaded the latest 3.7 version which is 3.7.4 from the python website. Any ideas why pip would not be working?

@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Jul 29, 2019

@runninbear5: Did you check your path variable? echo $PATH. Check if the pip command is in there, please. Maybe https://askubuntu.com/questions/1082136/how-can-i-use-pip3 or https://superuser.com/questions/769920/python3-pip-installed-but-pip3-command-not-found will help you there...

@MrMEScott

This comment has been minimized.

Copy link

commented Aug 1, 2019

I am getting the following curious dependency error when attempting to install python3-ws4py. It seems to be saying that it can't install ws4py because needs to be at a level no higher than the one it's trying to install. Which makes no sense to me. Can anyone help or suggest a solution to this?

FWIW this is on a Raspberry Pi 3B+ running Raspbian buster, fully up-to-date. Python3 is at 3.7.3. (I had installed aptitude in the hope it would do better at resolving the dependency than apt, but it identifies the same issue.)

pi@birdbox:~ $ sudo aptitude install python3-ws4py
The following NEW packages will be installed:
  python3-ws4py 
0 packages upgraded, 1 newly installed, 0 to remove and 92 not upgraded.
Need to get 39.7 kB of archives. After unpacking 170 kB will be used.
The following packages have unmet dependencies:
 python3.7 : Breaks: python3-ws4py (<= 0.4.2+dfsg1-2) but 0.4.2+dfsg1-2 is to be installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     python3-ws4py [Not Installed]                      

Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
Abort.
@SeppPenner

This comment has been minimized.

Copy link
Owner Author

commented Aug 1, 2019

FWIW this is on a Raspberry Pi 3B+ running Raspbian buster, fully up-to-date.

I haven't tried to update this yet, is on my list. Strange thing though...

@MrMEScott

This comment has been minimized.

Copy link

commented Aug 1, 2019

I am getting the following curious dependency error when attempting to install python3-ws4py.

Still digging on this. There are definitely no held packages, but could the issue possibly be connected to the following?

pi@birdbox:~ $ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done                            
E: Repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' changed its 'Suite' value from 'testing' to 'stable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

@MrMEScott

This comment has been minimized.

Copy link

commented Aug 1, 2019

could the issue possibly be connected to the following?

Nope. I ran "sudo apt-get update --allow-releaseinfo-change" and retried the install of python3-ws4py - still no dice. Exact same error from aptitude, and apt-get complains thus:

pi@birdbox:~ $ sudo apt-get install python3-ws4py
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-ws4py : Depends: python3:any (>= 3.3.2-2~)
E: Unable to correct problems, you have held broken packages.

Now wondering if there's an error in the python3-ws4py package on the Raspbian repository. FWIW, I was able to install the package on a separate (Ubuntu) system, but that probably doesn't prove anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.