Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Random albums not songs, how?
#11
(06-12-2020, 07:09 PM)HemiRick Wrote: ok followed your instructions and it appeared to install
running mpdrandom -h
get me this
pi@moodegarage:~/mpdrandom $ mpdrandom -h
Traceback (most recent call last):
  File "/usr/local/bin/mpdrandom", line 4, in <module>
    from lib.mpdrandom import main
  File "/usr/local/lib/python3.7/dist-packages/lib/mpdrandom.py", line 22, in <module>
    import mpd
ModuleNotFoundError: No module named 'mpd'
Its not working for some reason plz help Thanks

You might need to install the python-mpd2 package, like so:

Code:
pip install python-mpd2
Reply
#12
(06-12-2020, 08:02 PM)Pieter Wrote: You might need to install the python-mpd2 package, like so:

Code:
pip install python-mpd2

I did no help
pi@moodegarage:~ $ pip install python-mpd2
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting python-mpd2
  Downloading https://files.pythonhosted.org/packages/...ne-any.whl
Installing collected packages: python-mpd2
Successfully installed python-mpd2-1.0.0
pi@moodegarage:~ $ mpdrandom -h
Traceback (most recent call last):
  File "/usr/local/bin/mpdrandom", line 4, in <module>
    from lib.mpdrandom import main
  File "/usr/local/lib/python3.7/dist-packages/lib/mpdrandom.py", line 22, in <module>
    import mpd
ModuleNotFoundError: No module named 'mpd'
pi@moodegarage:~ $
Reply
#13
Looks like you're mixing Python 2 and Python 3 code/modules.
Reply
#14
(06-12-2020, 09:55 PM)TheOldPresbyope Wrote: Looks like you're mixing Python 2 and Python 3 code/modules.

What makes you conclude this? Nothing changed in the error mess. after installing py 2. 

How do I uninstall py 2?

I'm not a Linux guy and your comment is no help to making this work....Such a simple request which seemed to have such a simple answer.....nothing is ever easy.

This is the error: File "/usr/local/lib/python3.7/dist-packages/lib/mpdrandom.py", line 22, in <module>
import mpd
ModuleNotFoundError: No module named 'mpd'
Reply
#15
(06-13-2020, 03:40 AM)HemiRick Wrote:
(06-12-2020, 09:55 PM)TheOldPresbyope Wrote: Looks like you're mixing Python 2 and Python 3 code/modules.

What makes you conclude this? Nothing changed in the error mess. after installing py 2. 

How do I uninstall py 2?

I'm not a Linux guy and your comment is no help to making this work....Such a simple request which seemed to have such a simple answer.....nothing is ever easy.

This is the error:  File "/usr/local/lib/python3.7/dist-packages/lib/mpdrandom.py", line 22, in <module>
   import mpd
ModuleNotFoundError: No module named 'mpd'

Try forcing Python 3, like so:
Code:
pip3 install python-mpd2
Reply
#16
The GitHub repo for mpdrandom declares right on the homepage in the commit summary table:


Code:
    mpdrandom     Switch to python3     3 months ago


The shebang (#!) line in mpdrandom is


Code:
#!/usr/bin/env python3


The error message tells you where the mpdrandom.py module is stored

Code:
File "/usr/local/lib/python3.7/dist-packages/lib/mpdrandom.py"
                     ^^^^^^^^^


Conclusion: you're running a Python3 script.


OTOH, the default versions of Python and pip which execute in current moodeOS if you don't specify a version:

Code:
pi@moodelr:~ $ python -V
Python 2.7.16
pi@moodelr:~ $ pip -V
pip 18.1 from /usr/lib/python2.7/dist-packages/pip (python 2.7)


Finally, how you specify version 3:

Code:
pi@moodelr:~ $ python3 -V
Python 3.7.3
pi@moodelr:~ $ pip3 -V
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

Regards,
Kent
Reply
#17
TY Peiter , your simple command fixed it. It now works.
Reply


Forum Jump: