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

Issue with update 2.7.3: command not found in line 798 #485

Open
Marck80 opened this issue Oct 28, 2024 · 6 comments
Open

Issue with update 2.7.3: command not found in line 798 #485

Marck80 opened this issue Oct 28, 2024 · 6 comments
Labels
believe fixed / answered The bug is believed fixed in latest release

Comments

@Marck80
Copy link

Marck80 commented Oct 28, 2024

Thank you for this fantastic work.
I am writing to report a bug that I encountered while attempting to update. Specifically, I receive an error on line 798 during the update process.

Running on 'main' branch
Checking for updates...
Found a new version of Happy Hare on github, updating...
Now on git version v2.7.3-13-g0bf0e5d
Running the new install script...
Klipper config directory (/home/biqu/printer_data/config) found
Klipper klipper.service systemd service found
Reading default configuration parameters...
Reading mmu_parameters.cfg configuration from previous installation...
Reading mmu_software.cfg configuration from previous installation...
Reading mmu_sequence.cfg configuration from previous installation...
Reading mmu_cut_tip.cfg configuration from previous installation...
Reading mmu_form_tip.cfg configuration from previous installation...
Reading mmu_macro_vars.cfg configuration from previous installation...
Reading blobifier.cfg configuration from previous installation...
Reading mmu_erec_cutter.cfg configuration from previous installation...
Setting Blobifier variable_z_raise and variable_purge_length_maximum from previous settings
/home/biqu/klipper/Happy-Hare/install.sh: line 798: python: command not found
biqu@BTT-CB1:~/klipper/Happy-Hare$ nano /home/biqu/klipper/Happy-Hare/install.sh

triangular is defined later

    # Blobifer update - Oct 13th 20204
    if [ ! "${variable_iteration_z_raise}" == "" ]; then
        echo -e "${INFO}Setting Blobifier variable_z_raise and variable_purge_length_maximum from previous settings"
        variable_z_raise=$(python -c "print(${variable_iteration_z_raise} * ${variable_max_iterations_per_blob} - $(triangular $((variable_max_iterations_per_blob - 1))) * ${variable_iteration_z_change})")
        variable_purge_length_maximum=$(python -c "print(${variable_max_iteration_length} * ${variable_max_iterations_per_blob})")
    fi
}

triangular() {
    awk "BEGIN {print ($1 * ($1 + 1)) / 2}"
}
@Marck80 Marck80 changed the title Issue with update 2.7.3 Issue with update 2.7.3: command not found in line 798 Oct 28, 2024
@moggieuk
Copy link
Owner

Hmmm. Looks like python is not in your PATH. You can edit and change "python" to "/usr/bin/python" or if that fails "/usr/bin/python3".

I'll work with @Dendrowen and try to avoid using python and update...

@wdcocq
Copy link
Contributor

wdcocq commented Oct 28, 2024

Changing it to:

	if [ ! "${variable_iteration_z_raise}" == "" ]; then
		log_info "Setting Blobifier variable_z_raise and variable_purge_length_maximum from previous settings"
		variable_z_raise=$((variable_iteration_z_raise * variable_max_iterations_per_blob - $(triangular $((variable_max_iterations_per_blob - 1))) * variable_iteration_z_change))
		variable_purge_length_maximum=$((variable_max_iteration_length * variable_max_iterations_per_blob))
	fi

Should work, no need for python to do calculations
I was just parsing/changing this code anyway for my upcoming PR :)

@moggieuk
Copy link
Owner

I just pushed an update that uses "awk" instead of "python" to avoid PATH issues. Basically it is one time logic anyway.

@moggieuk
Copy link
Owner

moggieuk commented Oct 28, 2024

Unfortunately floating point calcs are difficult in borne shell.

Anyone reading ... please force an another update and the issue should be resolved.

@moggieuk moggieuk added the believe fixed / answered The bug is believed fixed in latest release label Oct 28, 2024
@wdcocq
Copy link
Contributor

wdcocq commented Oct 28, 2024

Ah yes, forgot about the floating points 😅

@Marck80
Copy link
Author

Marck80 commented Oct 28, 2024

I had /usr/bin/python3 and not python… I created a symbolic link (ln -s /usr/bin/python3 /usr/bin/python) and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
believe fixed / answered The bug is believed fixed in latest release
Projects
None yet
Development

No branches or pull requests

3 participants