n3bojs4 / octoprint-LCD1602

16 stars 12 forks source link

Pygments 2.6.1 erroring out on Python version < 3.5 (Octoprint 1.4.0) #11

Closed ChrisCollinsIBM closed 4 years ago

ChrisCollinsIBM commented 4 years ago

New to OctoPrint but not to package management!

Tried installing the plugin via the OctoPrint Plugin Manager and was erroring out on Pygments 2.6.1 (the auto resolved version from pip) complaining that it isn't compatible with Python 2.7.16 (Min 3.5)

20-04-27 22:31:24,689 > Collecting Pygments>=2.5.1 2020-04-27 22:31:24,690 > Downloading https://www.piwheels.org/simple/pygments/Pygments-2.6.1-py2.py3-none-any.whl (914kB) 2020-04-27 22:31:26,227 ! ERROR: Package 'Pygments' requires a different Python: 2.7.16 not in '>=3.5'

I manually installed Pygments 2.5.1 and subsequently 2.5.2 and things went through fine after that but just wanted to follow up and confirm if this is an issue or did I miss something?

I see that OctoPrint CAN be setup for Python 3 currently, but still currently ships as Python 2.x likely for compatibility.

Maybe worth adding something to the install guide? (unless I missed it?)

Thanks for the great work!

BrandenSebring commented 4 years ago

@Dak0ta i am having the same issue as you described. i have a generic 16 x 2 lcd screen i took from another project to use as my printers "display". (Robo 3d R1 +) and using a Pi 3 b+ the 2017 rev

Would you mind posting where you got pygments 2.5.1 and .2 (all im finding is the 2.6.1 for python 3 Edit** Found https://pypi.org/project/Pygments/#history

Also did you then install this LCD1602 package thru the octoprint plugIn manager or did you clone the git and install, like over ssh or something not using the octoprint plugIn manager?

ChrisCollinsIBM commented 4 years ago

For the next person who comes along:

On Octopi: ~/oprint/bin/pip install Pygments==2.5.2

Or wherever the pip for octoprint is installed in your distro. Make sure to use this one and not the pip from the OS.

Also did you then install this LCD1602 package thru the octoprint plugIn manager or did you clone the git and install, like over ssh or something not using the octoprint plugIn manager?

@BrandenSebring - After satisfying pip with a Pygments version the plugin needed ( >= 2.5.1 ) I was able to install through the plugin UI just fine.

n3bojs4 commented 4 years ago

Hello ! Sorry for this late answer. Did you try to add the needed packages in setup.py ? It's old is in my memory but it could fix the issue automatically. Enjoy the plugin 😁

n3bojs4 commented 4 years ago

Inside setup.py could fix the issue, but i don't have the set up to test it:

plugin_requires = ["RPLCD", "smbus2", "fake-rpi", "Pygments"]

ChrisCollinsIBM commented 4 years ago

Interesting point, if this package isn't explicitly trying to install Pygments then it's likely a transient dependency from one of the other package, maybe "fake-rpi" or some other dependency it has.

Is there a way for you to specify Pygments < 2.6.0? I would think explicitly asking for just the package will run into the same issue as it will auto-get the newest.

phiwa99 commented 4 years ago

Inside setup.py could fix the issue, but i don't have the set up to test it:

plugin_requires = ["RPLCD", "smbus2", "fake-rpi", "Pygments"]

I downloaded the .zip, changend the line in the setup.py and zipped it again. I manually uploaded the plugin to octoprint but the installer showed the same error.

Do you have an other idea how to fix it?

ChrisCollinsIBM commented 4 years ago

Inside setup.py could fix the issue, but i don't have the set up to test it: plugin_requires = ["RPLCD", "smbus2", "fake-rpi", "Pygments"]

I downloaded the .zip, changend the line in the setup.py and zipped it again. I manually uploaded the plugin to octoprint but the installer showed the same error.

Do you have an other idea how to fix it?

Manually install pygments 2.5.2 first with /home/pi/oprint/bin/pip install pygments==2.5.2

Then try installing the plugin again.

phiwa99 commented 4 years ago

This fixed it!

Further I used the changed setup.py with manual upload

Thanks

n3bojs4 commented 4 years ago

https://github.com/n3bojs4/octoprint-LCD1602/commit/2b0d6e60cdf54307753569524542e2fa5eeb0b94