diehardsk / Volumio-OledUI

Physical user interface for Volumio music player: 256x64 OLED display + 2x rotary encoder
MIT License
10 stars 11 forks source link

Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-9I5o9L/setuptools #4

Closed wuffer closed 3 years ago

wuffer commented 4 years ago

I try to get this working on a raspberry pi 4 but i get this error when i use sudo pip install --upgrade setuptools pip wheel

Maschine2501 commented 4 years ago

@wuffer : please paste the Error code here. Otherwise we can't assist you ;)

wuffer commented 4 years ago

After i use sudo pip install --upgrade setuptools pip wheel. I get this error

Command python setup.py egginfo failed with error code 1 in /tmp/pip-build-Zv1qa/setuptools

Maschine2501 commented 4 years ago

@wuffer Hi, I just tested it with my Pi4. You need to run this installation steps, the error comes from an outdated PIP installation...

Please make a clean/new Volumio SD-card before proceeding....

sudo apt-get update
sudo apt-get install -y python-dev python-pip libfreetype6-dev libjpeg-dev build-essential python-rpi.gpio
sudo python -m pip install --upgrade pip
sudo pip install --upgrade setuptools pip wheel
sudo pip install --upgrade socketIO-client luma.oled==3.1.0

...and here comes the next error. luma.core wants to have pytthon 3.5 or above..

ERROR: Package 'luma.core' requires a different Python: 2.7.9 not in '>=3.5, <4'

I ran into this by myself at tthe beginning of the year, and I was not able to solve this problem for python 2.7.9. @diehardsk Maybe you can investigate this problem?

I try'd to get Volumio-OledUI running, here are my further steps, after the luma error:

sudo apt-get install -y build-essential libc6-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
tar -zxvf Python-3.5.2.tgz 
cd Python-3.5.2 
./configure && make -j4 && sudo make install 
cd 
alias python3=python3.5
sudo apt-get install -y python3-dev python3-setuptools python3-pip libfreetype6-dev libjpeg-dev build-essential python-rpi.gpio libffi-dev libcurl4-openssl-dev libssl-dev git-core autoconf make libtool libfftw3-dev libasound2-dev libncursesw5-dev libpulse-dev libtool 
sudo pip3 install --upgrade setuptools pip wheel
sudo pip3 install --upgrade luma.oled
sudo pip3 install  requests socketIO-client
git clone https://github.com/diehardsk/Volumio-OledUI.git
chmod +x ~/Volumio-OledUI/oledui.py
sudo cp ~/Volumio-OledUI/oledui.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable oledui.service
rebootsudo apt-get update
sudo apt-get install -y python-dev python-pip libfreetype6-dev libjpeg-dev build-essential python-rpi.gpio
sudo pip install --upgrade setuptools pip wheel
sudo pip install --upgrade socketIO-client luma.oled==3.1.0
git clone https://github.com/diehardsk/Volumio-OledUI.git
chmod +x ~/Volumio-OledUI/oledui.py

@diehardsk : at least under python 3.5.2 there are some "bugs" in your code. They prevent the code from running.

@wuffer and @diehardsk The required changes, are as followed: (use "sudo nano Volumio-OledUI/oledui.py", "sudo nano Volumio-OledUI/modules/display.py" and "sudo nano Volumio-OledUI/oledui.service" to edit the files)

Line 109 - oledui.py must be:

print("render error")

Line 13 - display.py must be:

print("Cannot open file: ", filename)

To use the "autostart" of oledui under python 3.5.2 you need to change Line 7 - oledui.service to:

ExecStart=/usr/local/bin/python3 -u /home/volumio/Volumio-OledUI/oledui.py

After you changed the 3 parts, go on with:

sudo cp ~/Volumio-OledUI/oledui.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable oledui.service
reboot

@wuffer : If all this fail, maybe you can try my (upgraded) version of Volumio-OledUI. It is actually running on python 3.5.2 and I'm working on python 3.8.5...

@wuffer please ttry the suggested steps and give feedback

wuffer commented 4 years ago

Thank you. I did all the steps. And it worked. I haven't tried the (upgraded) version.

The only thing is if i change the album, it showing the last track but it helps when i press next a few times or remove album from playlist before adding a new.

But it works. :)

https://imgur.com/HOoFiwE

Maschine2501 commented 4 years ago

@wuffer : "The only thing is if i change the album, it showing the last track but it helps when i press next a few times or remove album from playlist before adding a new." -> then try my code... this works in NR1-UI

@diehardsk Maybe you'll have a look at your code and fix the Installation Steps and the "album change issue"

diehardsk commented 4 years ago

@Maschine2501 Hi! Thanks for your support! I've updated code to add parentheses as you pointed out. But I'll keep using python 2.x for now, the luma.core library is hopefully also possible to use its old version to make it work. @wuffer "album change issue" is hopefully fixed, please upload updated oledui.py and check it. I'm not sure if I simulated it the same way, it looked like song title was pushed only in volumio stop state, where I had it restricted for some ancient reason and so I just removed that.

wuffer commented 4 years ago

@Maschine2501 I will try yours next week, i do prefer 2 rotary encoders for the look. @diehardsk It did the trick. It works like it should. :) I did find another error. When turning the rotary encoder, after stopping or pushing it, the screen goes black and stays that way. The left rotary works fine with start/stop, volume and shutdown. :) I am using 24 steps rotary encoders, so i don't know if its my own fault or its the plugin.

diehardsk commented 4 years ago

strange, I don't have such problem. The screen is black only when playback is stopped. Number of steps doesn't matter. Could you copy some debug log if there is something? sudo journalctl -fu oledui.service And try to clean play queue if there is too many records.

wuffer commented 3 years ago

@diehardsk i get this error

Sep 14 05:20:49 volumio oledui[593]: TypeError: Can't convert 'bytes' object to str implicitly Sep 14 05:20:49 volumio systemd[1]: oledui.service: main process exited, code=exited, status=1/FAILURE Sep 14 05:20:49 volumio systemd[1]: Unit oledui.service entered failed state.

diehardsk commented 3 years ago

allright. Problem was happening only with python3 which is more strict in some cases. I believe it works now in python2.7 as well as python3. Please check with your setup wuffer. Thanks. (oledui.py)

wuffer commented 3 years ago

@diehardsk It works perfect :) Thank you.

diehardsk commented 3 years ago

Great!