ModuleNotFoundError: No module named 'encodings'
See original GitHub issueDescription Mariner can’t be started on DietPi
Reproduction Steps Steps to reproduce the behavior:
- Install DietPi on SD card, boot and do minimal setup to get a running system.
- Follow setup instructions to install mariner package from PPA
- (optional) Install
dbus
to make systemd behave properly
Expected Behavior
Mariner starts, preferably from the systemd unit, but manual start via sudo -u mariner mariner
is acceptable.
Screenshots / Logs
dietpi@marsbox:~$ sudo -u mariner mariner
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: initfsencoding: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Current thread 0xb6fc6a00 (most recent call first):
Aborted
Details:
- Mariner Version: 0.2.0-1
- Printer Model: Elegoo Mars
- Raspberry Pi Model: RPi Zero W
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
ImportError: No module named 'encodings' - python
I was facing this issue "ModuleNotFoundError: No module named 'encodings" after updating to macOS Catalina. I was having multiple versions of Python ...
Read more >ModuleNotFoundError: No module named 'encodings' in Python
To solve the ModuleNotFoundError: No module named 'encodings' error, make sure, your virtual environment is not glitched by recreating it and ensure Python ......
Read more >No Module named “Encodings” — A common ... - faun.dev
When you download Python3. · Then, open system properties and navigate to the “Advanced” tab. · Ensure that the Python path for your...
Read more >ModuleNotFoundError: No module named 'encodings' #516
I keep getting: ModuleNotFoundError: No module named 'encodings' in the unit error logs when trying to add new configuration.
Read more >No Module named “Encodings” — A ... - FAUN Publication
The Solution! · When you download Python3. · Then, open system properties and navigate to the “Advanced” tab. · Ensure that the Python...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jangrewe
I fixed it by copying python 3.9 to the mariner directory, copying some files from python3.7 to python3.9 directory, and editing/relaunching the post-install script. It’s faster than compiling required Python on Zero.
Symlink Python 3.7 to the Python 3.9
Copy Python 3.9 libs to the mariner:
sudo cp -r /usr/lib/python3.9 /opt/venvs/mariner3d/lib/python3.9
Go to the mariner directory and copy some files/dirs from the Python 3.7 to the Python 3.9 directory:
Edit postinstall script adding Python 3.9 version - find the next string and add Python 3.9 version:
sudo nano /var/lib/dpkg/info/mariner3d.postinst
local pythonX_Y=$(cd “$dh_venv_install_dir/lib” && ls -1d python3.9 | tail -n1)Run postinstall script:
sudo /var/lib/dpkg/info/mariner3d.postinst configure
Now web interface is running but there are another error “Unexpected Printer Response” (I don’t have a connected printer yet, so not sure if this error cannot be due to this fact)
‼️https://github.com/luizribeiro/mariner/issues/481#issuecomment-968325624 is harmful because you are basically mixing two versions of python hoping for the best, maybe it worked, fine, but you may have screwed the installation of any other softwares relying on Python 3.9 you may want to install later.
I’m in the process of writing a comprehensive issue with a sane solution included, maybe using pyenv.