Klipper Python 3

Hi guys, hope all is going well.
It's been along time since Klipper switched to Python 3...
Can you guys please update the installer to use python3. (Or is there a way to override the version during install?) 

I do remember reading on here a command line override what version Klipper was installed but cant recall where... so maybe thats an option??

Also the Numpy that gets installed for Input Shaper also is for version 2 as well.. can you please update numpy too.

I've have been able to setup repetier-server to utilize a kiauh installed klipper with python3, But I'd rather use the install button as the "Install input shaper" doesnt show up until that button is pressed.

Comments

  • edited July 2023
    /=======================================================\
    |     ~~~~~~~~~~~~~~~~~ [ KIAUH ] ~~~~~~~~~~~~~~~~~     |
    |        Klipper Installation And Update Helper         |
    |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     |
    \=======================================================/

    ###### Initializing Klipper installation ...

    /=======================================================\
    | Please select your preferred Python version.          |
    | The recommended version is Python 3.x.                |
    |-------------------------------------------------------|
    |  1) [Python 3.x]  (recommended)                       |
    |  2) [Python 2.7]  (legacy)                            |
    |-------------------------------------------------------|
    |                       B) « Back                       |
    \=======================================================/
    ###### Select Python version: 1

    Just an FYI, even kiauh has it recommended and its all been ported over.

  • I will have a look into this, but it is hard to find any information on this. We just pull the official github and it decides for python2 virt env as it seems, also python 3 was on my device and is listen as can be used in requirements. 
  • Thank you, I appreciate the help.

  • Repetier said:
    I will have a look into this, but it is hard to find any information on this. We just pull the official github and it decides for python2 virt env as it seems, also python 3 was on my device and is listen as can be used in requirements. 
    I installed Python 3 and still was unable to install a printer with the klipper wizard. How did you get it to work with 3 if you don't mind my asking? 

  • I did not - it selected v2 automatically. I need to figure out how to tell it to use v3 if available.
  • as a preface, I run klipper on laptops.. I dont own a Pi

    I run ubuntu server version, no gui on the 2gb laptop, it remains lid shut with no battery installed for safety.

    As a workaround for the python3 issue I force repetier_server to use an already installed klipper instance...
    I first start by a fresh instuall of Ubuntu server. Modifiy it so it doesnt sleep when the lid closes.
    then I installed klipper (w/python3) via kiauh, setup the printer with fluidd/mainsail and a basic working printer config... (ie no extra macros or any included files, I add those later) 
    I add input_shaper and its normal install via ssh
    then shutdown klipper instance via fluidd/mainsail.
    Then installed repetier-server via ssh, then add a printer, name the printer "printer" with klipper firmware type and /dev/serial/by-id/usb-klipper..blabla.. as the port
    (note: it auto changes it to /var/lib/klipper/sockets/printer after conneting)
    install klipper button
    copy pasted running config from /home/pi/printer_data/config/printer.cfg
    make sure it comes up ok
    next installed input-shaper via klipper-configuration

    (note: naming the printer "printer" causes the configuration file to be named printer.cfg)

    then I stop the klipper instance of repetier-server via fluidd/mainsail called printer
    I then sync the printer.cfg with both with one exception... (its not required see comments below)
    then I restart the kiauh klipper instance from fluidd/mainsail and verified it came up ok

    I was able to tell repetier-server to use a klipper instance installed by kiauh, by going back into repetier-server printer settings and changing the port to /home/pi/printer_data/comms/klippy.serial
    this forces repetier server to use the same running instance as kiauh installed klipper.
    this gives all live comms from repetier-server to the printer
    one other note, ive never gotten the charts after input shaper runs regardless of which klipper instance I use. 
    but it does run and will update the config but see note below.

    Meanwhile, I do not recommend using both interfaces at the same time as: So please use repetier-server only after its all setup. Although I have used mainsial/fluidd interface to restart a stuck instance of klipper when repetier-server wont restart it. Generally speaking restart klipper command inside klipper configuration does work... Although if either dont restart it, it usually was due to a stuck input shaper rp2040, which every so often needs a usb cable unplugged to get it to restart.

    Ok, given all this: I have to say a couple notes:

    1) Although any commands or movments done in Repetier-server do show up in mainsail/fluidd...
    The reverse is not the case. IE when movments or commands done in mansail/fluidd. Do not show up in repetier-server.
    so for an example:

    a Home-all done in either do home the printer in both cases, but... if done in mainsail/fluidd it doesnt indicate home position in repetier-server. but if homed in repetier-server it does show home position in mainsail/fluidd.
    So once setup, try to obstain from using mainsail/fluidd. 

    2) the klipper config inside repetier-server is not used at all when it is in this mode. So even though I try to keep them the same, the changes made in repetier-server when a SAVE_CONFIG is run, updates the config in mainsail/fluidd but not in repetier-server klipper configuration.

    Else, this works great. I also as a final word, added the /home/pi/printer_data/gcodes as a folder in repetier-server So any gcode files that get sent to the mainsial/fluidd queue, can be imported into repetier-server by opening the folder and importing.  That way if a slicer cant talk to repetier-server but can talk to klipper/mainsail/fluidd/octoprint... you can sitll upload the gcode files and get to them in repetier-server.

    I hope this helps, I really like having the best of both worlds, and if I wasnt disabled and have 0 budget, I would own a copy of the pro version. !! I love it so much. !!

    Oh is there a way to post screen shots in here??
  • Image uploads are not possible, but you can use free image stoarge services and post the link here.
  • Looks like it was quite simple in the end, Just forcce virtualenv to use Python 3. If browser cache is cleared you should now see python 2 and python 3 options for 0.11 and latest git version.
Sign In or Register to comment.