This section intended to store my general notes, if you see this usefull to apply it to you, feel free to use it. Credit to ChatGPT as well.
To install K40 Whisperer on macOS, follow these steps:
Python Installation:
Install Homebrew (if not already installed):
Open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
3. Install required dependencies:
Install libusb via Homebrew
brew install libusb
Download K40 Whisperer:
Visit the K40 Whisperer GitHub page or the official website.
Download the latest .zip file for macOS.
Extract the Files:
Unzip the downloaded file into a directory of your choice.
Install Required Python Libraries:
Navigate to the extracted directory in Terminal:
cd /path/to/k40whisperer
Install required Python libraries:
pip3 install -r requirements.txt
Run K40 Whisperer:
In the same directory, run the program:
python3 k40_whisperer.py
5. Create a Shortcut for Easier Access (Optional):
Create a shell script or an alias to launch K40 Whisperer from anywhere:
echo 'alias k40whisperer="python3 /path/to/k40whisperer/k40_whisperer.py"' >> ~/.zshrc
source ~/.zshrc
Now, type k40whisperer in Terminal to start the program.
Ensure the K40 laser machine is properly connected via USB to your Mac.
Find the current Python installation:
which python3
which pip3
These commands will show the installation paths for Python 3 and pip3.
If Python was installed via the official installer:
Remove the Python framework manually:
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.x
Replace 3.x with the installed version (e.g., 3.12).
Remove symbolic links:
sudo rm /usr/local/bin/python3
sudo rm /usr/local/bin/pip3
Install Python 3 via Homebrew:
brew install python
Verify the installation:
python3 --version
pip3 --version
Upgrade pip:
python3 -m pip install --upgrade pip
Create a virtual environment for your project:
python3 -m venv k40_env
source k40_env/bin/activate
Install required dependencies:
pip install -r requirements.txt
Test if pip3 works properly:
pip3 --version
Determine the directory where the command is running:
pwd
If this directory is restricted (e.g., a protected system directory or a mounted volume), move the project files to a user-owned directory like ~/Documents or ~/Projects.
If your project is in a restricted folder, move it to a safe location:
Create a new directory:
mkdir ~/Projects/K40Whisperer
Move the project files:
mv /path/to/k40whisperer/* ~/Projects/K40Whisperer
Navigate to the new directory:
cd ~/Projects/K40Whisperer
Recreate the virtual environment in the new location:
Delete the old environment:
rm -rf k40_env
Create a new virtual environment:
python3 -m venv k40_env
Activate the virtual environment:
source k40_env/bin/activate
Upgrade pip:
pip install --upgrade pip
Install the dependencies:
pip install -r requirements.txt
If the issue persists:
Check permissions for the directory:
ls -ld $(pwd)
Ensure you own the directory and have write access. If not, change ownership:
sudo chown -R $(whoami) $(pwd)
Set appropriate permissions:
chmod u+rwx $(pwd)
Run your pip command or script again:
pip install -r requirements.txt
Run the following command to check if tkinter is available:
python3 -m tkinter
If the command does not open a blank GUI window or shows an error, proceed to install tkinter.
macOS Homebrew Installation: If Python was installed via Homebrew, you'll need to ensure tkinter is installed with it:
brew install python-tk
Reinstall Python with tkinter Support: If the above doesn't work, reinstall Python using Homebrew with the tcl-tk dependency:
brew install tcl-tk
brew reinstall python
Verify Installation: After reinstalling Python, check if tkinter is now included:
python3 -m tkinter
If you encounter further issues:
Find the Tcl/Tk installation directory:
brew info tcl-tk
Note the directory (e.g., /opt/homebrew/opt/tcl-tk).
Set environment variables to link Python with Tcl/Tk:
export PATH="/opt/homebrew/opt/tcl-tk/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/tcl-tk/lib"
export CPPFLAGS="-I/opt/homebrew/opt/tcl-tk/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/tcl-tk/lib/pkgconfig"
Rebuild Python:
brew reinstall python
Activate the virtual environment:
source k40_env/bin/activate
Run K40 Whisperer again:
bash
Copy code
python3 k40_whisperer.py
Last but not least, need to edit the before execute code python3 k40_whisperer.py need to edit the k40_whisperer.py file to suite with latest python program. You may download it here which I already edit it.
Testing Required:
These values are a starting point; always test on scrap material first.
Speed and Power Limits:
The speed limit for machine is 100mm/s. Ensure no operation exceeds this limit.
Multiple Passes:
Materials like wood, leather, and thicker plastics often require multiple passes for clean cuts.
Ventilation:
Ensure proper extraction for all operations to handle smoke and fumes, especially for plastics and leather.