New release candidate: 1.4.0rc1

As said in the first post:

There's a misunderstanding here. OctoPrint cannot and will not magically switch the environment it's running in to Python 3. But it can now be run under Python 3 environments which so far was not possible.

Somewhere down the road OctoPi will switch to Python 3 by default then.

Probably creating a Python 3 virtualenv (or recreating /home/pi/oprint as one) and installing OctoPrint into that. I think Python 3 should definitely be already available on jessie and buster images (0.16 and 0.17 in OctoPi terms) so that should be pretty straight forward.

Thanks @foosel

It's true, I've tried to remove complitly python2.7 from octopi (apt-get/aptitude) and I had to reinstall all!!!
I'ts not a problem, but I'm not a programmer.
I can test but I need to know how to switch from py2.7 to 3.x

Thank you.

Leo

Python 3 and Python 2 can be installed side-by-side, so there is no need to uninstall Python 2. With OctoPi, an additional copy of Python 2 is installed in the folder "oprint", so removing the system installed Python 2 - even if succesful - changes nothing to how OctoPrint runs.

A version of Python 3 is already available on your OctoPi image. I was mainly wondering how to make an "oprint3" to run OctoPrint in.

I'm not sure if this workflow is correct but I've used something like this before on the Pi:

  1. pip3 install pip --upgrade # upgrade pip3 globally
  2. mv ~/OctoPrint ~/OctoPrint.py2
  3. cd ~
  4. git clone https://github.com/foosel/OctoPrint.git
  5. sudo service octoprint stop
  6. mv ~/oprint ~/oprint.py2
  7. virtualenv -p python3 oprint # Create a Python 3—based virtual environment
  8. source oprint/bin/activate # Activate it
  9. cd OctoPrint
  10. git checkout devel # Set things to the development branch, for example. See notes below
  11. python setup.py clean
  12. pip install .
  13. octoprint serve

Here, I'm saving the original ~/OctoPrint and ~/oprint folders so that you could in theory go back to your earlier setup, assuming that you exercised the Backup plugin. I used devel as an example branch but that's not necessarily what you might want for what you're doing.

Personally, I like to re-use the ~/oprint virtual environment name for the sake of consistency in other scripts you might have. Others might disagree with me on this.

Notes:

Before any of this, you might want to run python3 --version before activating the virtual environment to verify which version of Python 3 you're running. The target for OctoPrint development is either 3.6 or 3.7 (unsure).

Maybe somebody else can accurately identify what the git checkout ... command should be for this or offer an alternative workflow.

2 Likes

Thanks for this new RC and your hard work!

As the timelapse can use h264, can the livestream use h264 too?
It can save lot of bandwith and increase the quality of the stream.

Many thanks!

1 Like

@OutsourcedGuru .... I try!

Steps made and "problem found".

pi@octopi:~ $ sudo apt-get install python3-pip
pi@octopi:~ $ mv OctoPrint/ OctoPrint.py2
pi@octopi:~ $ git clone https://github.com/foosel/Octoprint.git
pi@octopi:~ $ sudo service octoprint stop
pi@octopi:~ $ mv oprint/ oprint.py2
pi@octopi:~ $ virtualenv -p python3 oprint
(oprint) pi@octopi:~ $ cd OctoPrint
-bash: cd: OctoPrint: No such file or directory
(oprint) pi@octopi:~ $ ls
mjpg-streamer  **Octoprint**  OctoPrint.py2  oprint  oprint.py2  scripts
(oprint) pi@octopi:~/Octoprint $ git checkout devel
Branch 'devel' set up to track remote branch 'devel' from 'origin'.
Switched to a new branch 'devel'
(oprint) pi@octopi:~/Octoprint $ python setup.py clean
running clean
'build/lib' does not exist -- can't clean it
'build/bdist.linux-armv7l' does not exist -- can't clean it
'build/scripts-3.7' does not exist -- can't clean it
recursively removing *.pyc from 'src'
removing 'me/pi/Octoprint/src/octoprint_setuptools/__pycache__/__init__.cpython-37.pyc'
removed me/pi/Octoprint/src/octoprint_setuptools/__pycache__ since it was empty
(oprint) pi@octopi:~/Octoprint $ pip install .
[A lot of things!]

Run it!
It's correct ?!?!?!

  • Starting OctoPrint 1.5.0.dev1+g4469a2d8

| hardware:
| cores: 4
| freq: 1400.0
| ram: 385253376
| os:
| id: linux
| platform: linux
| plugins:
| pi_support:
| model: Raspberry Pi 3 Model A Plus Rev 1.0
| octopi_version: 0.17.0
| python:
| pip: 19.3.1
| version: 3.7.3
| virtualenv: /home/pi/oprint

BTW I prefer also to maintain only one environment, what I need to modify ??

Thank you

Thank you

In my line 4 above I've done a stylized capitalization of OctoPrint. In your git clone command you have not... and then your cd command into that folder seems to have failed (due to the lowercase "p" perhaps). And then somehow you're now in the ~/Octoprint folder.

Remember from my tentative instructions that maybe devel isn't the branch you should be chasing? The topic of this thread is "1.4.0rc1" and devel isn't the same thing.

I would suggest holding off at this point. If you want to go back to what you had before:

deactivate # This is only necessary if your prompt starts with "(oprint)"
cd ~
rm -Rf ~/Octoprint
rm -Rf ~/oprint
mv ~/oprint.py ~/oprint
mv ~/OctoPrint.py2 ~/OctoPrint
sudo reboot
1 Like

On future release, for stability, is it possible to boot Octopi on USB key ?

I see no reason why it shouldn't work :slight_smile:

https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

And the RPis can boot from USB without further addition...
AFAIK, in the moment you still need a boot loader on SD card

Only for the first two models.
Raspberry Pi 2B v1.2, 3A+, 3B, and 3B+ (and maybe 4 but I'm not sure if it's ready yet) are able to boot without an sd card

1 Like

Yes, but you have to change things on the Pi and they can't be undone:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

Yes on some devices you have to choose between USB host boot mode and USB device mode.
The pi 3 also requires the USB boot mode bit for network boot

Hi @OutsourcedGuru

The branch difference from devel and '1.4.0rc1' was unclear for me since now, now I have learned a new piece!

BTW don't worry, I've spent last 35 year working with computer(s), but I'm not a programmer :wink:

Fast path to go back is to have 2 SD... or reinstall OctoPrint in 4 mins.

Thank you and regards.

Leo

Absolutely. I have a library of microSD cards and a database to know which one holds what.

1 Like

Got it.
Thank you!

2019-11-28 19:58:11,534 - octoprint.startup - INFO - Starting OctoPrint 1.4.0rc1

1 Like

This is really great ! I will test right now.

I would suggest testing 1.4.0rc2 instead :wink:

1 Like