Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

octoklipper error: externally-managed-environment #493

Open
zaid-hm opened this issue Jul 6, 2024 · 7 comments · May be fixed by #502
Open

octoklipper error: externally-managed-environment #493

zaid-hm opened this issue Jul 6, 2024 · 7 comments · May be fixed by #502

Comments

@zaid-hm
Copy link

zaid-hm commented Jul 6, 2024

I'm trying to run klipper on a galaxy tab A (2019)
But when running the command in the instruction I get the following error:


bash -c "$(curl -fsSL https://raw.githubusercontent.com/feelfreelinux/octo4a/master/scrip
ts/setup-klipper.sh)"
Setting up klipper
Do you have "Plugin extras" installed? (y/n): y
Installing dependencies...

OK: 404 MiB in 183 packages
error: externally-managed-environment

× This environment is externally managed
╰─>
    The system-wide python installation should be maintained using the system
    package manager (apk) only.

    If the package in question is not packaged already (and hence installable via
    "apk add py3-somepackage"), please consider installing it inside a virtual
    environment, e.g.:

    python3 -m venv /path/to/venv
    . /path/to/venv/bin/activate
    pip install mypackage

    To exit the virtual environment, run:

    deactivate

    The virtual environment is not deleted, and can be re-entered by re-sourcing
    the activate file.

    To automatically manage virtual environments, consider using pipx (from the
    pipx package).

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
localhost:~# bash -c "$(curl -fsSL https://raw.githubusercontent.com/feelfreelinux/octo4a/master/scrip
ts/setup-klipper.sh)"
@Bartouzz
Copy link

Bartouzz commented Jul 8, 2024

There is a new script for the 2.0.0 version of octo4a

https://github.com/feelfreelinux/octo4a/blob/master/scripts/setup-klipper-moonraker.sh

By the way i'm still figuring out, how to get it to work i'm running network error.
Maybe you should install 1.2.6 version of octo4a and use the command line you did.

@zaid-hm
Copy link
Author

zaid-hm commented Jul 8, 2024

@Bartouzz did you manage to get it to work, I'm running into a network issue as well

@Bartouzz
Copy link

Bartouzz commented Jul 8, 2024

@zaid-hm Still not ... Starting to lose hope, see my current klippy log:

mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 13] Could not exclusively lock port /dev/ttyOcto4a: [Errno 13] Permission denied
webhooks client 489798200720: New connection
webhooks client 489798200720: Client info {'program': 'Moonraker', 'version': 'v0.8.0-384-g8f3b30a'}
mcu 'mcu': Unable to open serial port: [Errno 13] Could not exclusively lock port /dev/ttyOcto4a: [Errno 13] Permission denied

seem's like permission problem but i can't find the right answer. i'll post if get something

EDIT: If someone can help...

@schmttc
Copy link

schmttc commented Jul 26, 2024

I'm working on this issue, am updating the klipper install script to work with octo4a 2.0
Once I've done some testing will provide the details for you to confirm.

@schmttc
Copy link

schmttc commented Jul 27, 2024

I've fixed the environment and permission denied error, but have run into the next error (non rooted device) https://github.com/schmttc/octo4a/blob/schmttc-patch-1/scripts/setup-klipper.sh
Have confirmed that Klipper on a Raspberry Pi 3B is working with the printer.

mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/klipper/klippy/serialhdl.py", line 262, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/klipper/klippy/serialhdl.py", line 319, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed

@schmttc schmttc linked a pull request Aug 1, 2024 that will close this issue
@schmttc
Copy link

schmttc commented Aug 1, 2024

I've used setup-klipper-moonraker.sh and reduced it to only install Klipper, which resolves all issues.

Please try https://github.com/schmttc/octo4a/blob/klipper-fix/scripts/setup-klipper.sh

Note, you will get this error in klippy.log if Klipper is not set to the correct serial port, or the printer is not available/powered off. This error will go away once the printer is connected and configured correctly.

mcu 'mcu': Starting serial connect
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/root/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/klipper/klippy/serialhdl.py", line 262, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/klipper/klippy/serialhdl.py", line 319, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/root/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/root/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed

@schmttc
Copy link

schmttc commented Aug 1, 2024

This may need more troubleshooting, while everything kicked off OK either Octoprint or Klipper crashed part way though a test print

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants