Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should this work with Python 3 on PiCroft? PIP error #2

Open
neil969 opened this issue Jul 8, 2018 · 6 comments
Open

Should this work with Python 3 on PiCroft? PIP error #2

neil969 opened this issue Jul 8, 2018 · 6 comments
Labels
good first issue Good for newcomers

Comments

@neil969
Copy link

neil969 commented Jul 8, 2018

I have tried installing AV music on PiCroft and the MSM installation fails with an error at "sudo pip ...blah..."
This is the second time I have tried ( this was on a fresh install), and the first time I asked about the missing PIP on the forums, and was told that it doesn't exist inPython3 and that the advice is not to install it on the "base" system.
After all of that, AVmusic is in the list of "good" community skills, so I thought I would try again about a Month later (today) . I manually installed the player first after doing a full apt-get update && upgrade.
Should it work, or is it not ready for Python3 version PiCroft, or is this a bug?
Thanks

@reginaneon
Copy link
Owner

Hey @neil969. It should work for Pi and it has been working for me. I modified the requirements.sh for the packages install. Let me know if the issue persists, I will look into it in more details if it does. Thank you for pointing this out.

@reginaneon reginaneon added the good first issue Good for newcomers label Jul 10, 2018
@neil969
Copy link
Author

neil969 commented Jul 10, 2018

Thanks for the info...
Now I have a failed skill install that I can't get rid of..
"msm install AVmusic" asks for Github credentials but then fails (as below)
So when I attempted to install it originally, I used "msm install https://github.com/reginaneon/AVmusic" Which worked except it failed at "sudo pip blah" command as above. and said that may not work (which it didn't :) )
So NOW, when I try "msm install https://github.com/reginaneon/AVmusic" it tell me that it exists,
Like this:
Searching for for 'https://github.com/reginaneon/AVmusic'...exists
msm: error 20
"msm remove" returns:
'https://github.com/reginaneon/AVmusic' was not found in the mycroft-skills repo
msm: error 252
and "msm remove AVmusic" returns:
Skill 'AVmusic-skill' has not been installed, nothing to remove.
msm: error 253

I don't know how to get past this to see if it will install with the modified requirements.sh, sorry
Any advise? Lats time it got all confused I ended up clean installing, and this IS the clean install, and the only skill I have tried installing is this one .
Thanks
(lengthy error below)

pi@picroft:~ $ msm remove AVmusic
Searching for 'AVmusic'...
Skill 'AVmusic-skill' has not been installed, nothing to remove.
msm: error 253
pi@picroft:~ $ msm install AVmusic
Searching for for 'AVmusic'...installing
Installing from: https://github.com/NeonGeckoCom/AVmusic-skill.git
/usr/bin/python: No module named mycroft.messagebus
Cloning into 'AVmusic-skill'...
Username for 'https://github.com': neil969
Password for 'https://neil969@github.com':
remote: Repository not found.
fatal: repository 'https://github.com/NeonGeckoCom/AVmusic-skill.git/' not found
/home/pi/bin/msm: line 321: cd: AVmusic-skill: No such file or directory
ERROR: Unable to access directory AVmusic-skill!
/usr/bin/python: No module named mycroft.messagebus
/usr/bin/python: No module named mycroft.messagebus
msm: error 102

@reginaneon
Copy link
Owner

Thank you for the detailed description. It looks like it might be msm or submodules issue with mycroft's repository. As your report says, it tried to install AVmusic from my repository "reginaneon", which is correct and should be from there. However, the next attempts to source it from a nonexistent URL or "NeonGecko/AVmusic", which doesn't make much sense. Thank you for bringing this to my attention. I let Kathy know about this as well so we can fix this together. I really appreciate you pointing this out - this is a great issue to report.

@KathyReid
Copy link

Thanks for flagging this with me @reginaneon and thanks to @neil969 for reporting this as well; the information you both provided was very useful.

Replicate the issue

Using a Picroft running the 14 March base image, running 18.2.10b of mycroft-core, I dropped out of the mycroft-cli-client and ran the following;

pi@picroft:~ $ msm install https://github.com/reginaneon/AVmusic
Searching for for 'https://github.com/reginaneon/AVmusic'...installing
Installing from: https://github.com/reginaneon/AVmusic
/usr/bin/python: No module named mycroft.messagebus
Cloning into 'AVmusic'...
remote: Counting objects: 92, done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 92 (delta 28), reused 72 (delta 11), pack-reused 0
Unpacking objects: 100% (92/92), done.
Checking connectivity... done.
  Setting up native environment...
Resolving                     [=========================]         
Installing                    [=========================]         
Querying                      [ ==                      ]         ==== AUTHENTICATING FOR org.freedesktop.packagekit.package-install ===
Authentication is required to install software
Authenticating as: root
                              [=========================]         
Waiting for authentication    [ ==                      ]         Password: 
                              [       ==                ]         polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
                              [=========================]         
Finished                      [=========================]         
Fatal error: Failed to obtain authentication.
  Installing requirements...
sudo: pip: command not found
ERROR: Unable to install requirements for 'AVmusic', it may not work
/usr/bin/python: No module named mycroft.messagebus
/usr/bin/python: No module named mycroft.messagebus
msm: error 121

Attempt to resolve issue

This shows that Picroft is still using the old (bash-based) version of msm. The new version of msm is based on Python, and throws Python errors.

I tried the following;

pi@picroft:~ $ sudo rm -R /opt/mycroft/skills/reginaneon-av-music.reginaneon/
pi@picroft:~ $ sudo rm -R /opt/mycroft/skills/AVmusic
rm: cannot remove ‘/opt/mycroft/skills/AVmusic’: No such file or directory

This cleared any previous Installs / Install attempts

Next, we activate the virtual environment.
This is documented more fully in the msm documentation:
https://mycroft.ai/documentation/msm/

pi@picroft:~ $ source /opt/venvs/mycroft-core/bin/activate

This changes the shell prompt slightly, ie: (mycroft-core) pi@picroft:~ $

Next, attempt to install:

(mycroft-core) pi@picroft:~ $ msm install https://github.com/reginaneon/AVmusic
WARNING - Failed to update repo: GitException(Git command failed: GitCommandError(['git', 'config', 'remote.origin.url', 'https://github.com/MycroftAI/mycroft-skills'], 255, b'error: could not lock config file .git/config: Permission denied', b''))
INFO - Downloading skill: https://github.com/reginaneon/AVmusic.git
Hit https://deb.nodesource.com jessie InRelease                     
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie InRelease
Hit https://deb.nodesource.com jessie/main Sources             
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages                                           
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit https://deb.nodesource.com jessie/main armhf Packages                     
Hit http://repo.mycroft.ai debian InRelease                                                                 
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages                                        
Get:1 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]                     
Hit http://archive.raspberrypi.org jessie/ui armhf Packages                                                 
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages                                       
Hit http://repo.mycroft.ai debian/main armhf Packages                                                       
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages                                            
Get:2 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]                                          
Get:3 https://deb.nodesource.com jessie/main Translation-en [162 B]                                         
Get:4 http://repo.mycroft.ai debian/main Translation-en [336 B]                                             
Get:5 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]                                      
Get:6 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]                                          
Get:7 https://deb.nodesource.com jessie/main Translation-en [162 B]                                         
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB                                            
Get:8 http://repo.mycroft.ai debian/main Translation-en [336 B]                                             
Get:9 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]                                      
Ign http://archive.raspberrypi.org jessie/main Translation-en                                               
Get:10 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]                                         
Get:11 https://deb.nodesource.com jessie/main Translation-en [162 B]                                        
Get:12 http://repo.mycroft.ai debian/main Translation-en [336 B]                                            
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB                                              
Get:13 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]                                     
Get:14 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]                                         
Ign http://archive.raspberrypi.org jessie/ui Translation-en                                                 
Get:15 https://deb.nodesource.com jessie/main Translation-en [162 B]                                        
Get:16 http://repo.mycroft.ai debian/main Translation-en [336 B]                                            
Get:17 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]                                     
Ign https://deb.nodesource.com jessie/main Translation-en_GB                                                
Get:18 https://deb.nodesource.com jessie/main Translation-en [162 B]                                        
Ign https://deb.nodesource.com jessie/main Translation-en                                                   
Get:19 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]                                         
Ign http://repo.mycroft.ai debian/main Translation-en_GB                                                    
Get:20 http://repo.mycroft.ai debian/main Translation-en [336 B]                                            
Ign http://repo.mycroft.ai debian/main Translation-en                                                       
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB                                     
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Reading package lists... Done
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mpv is already the newest version.
The following packages were automatically installed and are no longer required:
  libpython-dev libpython2.7-dev python-dev python2.7-dev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
INFO - Successfully ran requirements.sh for reginaneon-av-music
INFO - Installing requirements.txt for reginaneon-av-music
INFO - Successfully installed reginaneon-av-music

If you try the above @neil969, does it install OK for you?

Best, Kathy

@neil969
Copy link
Author

neil969 commented Jul 24, 2018

Hi Kathy
Sorry for the delay I have been away! Thanks for this, I am still frustrated though .
when i follow you instructions above I get errors at the msm install as below :(
EDIT!!! - I tried again (just doing the same stuff and it DID install OK - YAY!!!
Now Mycroft is telling me "an error occurred" when I try to play something LOL! - Making progress thou, I will see what is happening in the next day or so .
(I am leaving the stuff I pasted here anyway)

`(mycroft-core) pi@picroft:~ $ msm install https://github.com/reginaneon/AVmusic
WARNING - Failed to update repo: GitException(Git command failed: GitCommandError(['git', 'config', 'remote.origin.url', 'https://github.com/MycroftAI/mycroft-skills'], 255, b'error: could not lock config file .git/config: Permission denied', b''))
INFO - Downloading skill: https://github.com/reginaneon/AVmusic.git
Ign http://archive.raspberrypi.org jessie InRelease
Hit https://deb.nodesource.com jessie InRelease
Hit https://deb.nodesource.com jessie/main Sources
Ign http://archive.raspberrypi.org jessie Release.gpg
Hit https://deb.nodesource.com jessie/main armhf Packages
Ign http://archive.raspberrypi.org jessie Release
Get:1 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]
Get:2 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:3 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]
Get:4 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:5 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]
Get:6 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:7 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]
Get:8 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:9 https://deb.nodesource.com jessie/main Translation-en_GB [162 B]
Ign https://deb.nodesource.com jessie/main Translation-en_GB
Get:10 https://deb.nodesource.com jessie/main Translation-en [162 B]
Ign https://deb.nodesource.com jessie/main Translation-en
Err http://archive.raspberrypi.org jessie/main armhf Packages
503 Service Unavailable [IP: 93.93.135.188 80]
Err http://archive.raspberrypi.org jessie/ui armhf Packages
503 Service Unavailable [IP: 93.93.135.188 80]
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://repo.mycroft.ai debian InRelease
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Hit http://repo.mycroft.ai debian/main armhf Packages
Get:11 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Get:12 http://repo.mycroft.ai debian/main Translation-en [336 B]
Get:13 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]
Get:14 http://repo.mycroft.ai debian/main Translation-en [336 B]
Get:15 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]
Get:16 http://repo.mycroft.ai debian/main Translation-en [336 B]
Get:17 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]
Get:18 http://repo.mycroft.ai debian/main Translation-en [336 B]
Get:19 http://repo.mycroft.ai debian/main Translation-en_GB [339 B]
Ign http://repo.mycroft.ai debian/main Translation-en_GB
Get:20 http://repo.mycroft.ai debian/main Translation-en [336 B]
Ign http://repo.mycroft.ai debian/main Translation-en
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/jessie/main/binary-armhf/Packages 503 Service Unavailable [IP: 93.93.135.188 80]

W: Failed to fetch http://archive.raspberrypi.org/debian/dists/jessie/ui/binary-armhf/Packages 503 Service Unavailable [IP: 93.93.135.188 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR - Requirements.sh failed with error code: 100
SystemRequirementsException: 100
`

@neil969
Copy link
Author

neil969 commented Jul 24, 2018

Here is the error.. surprise surprise it is a permission error in Linux!! Imagine that! :)

20:40:55.708 - mycroft.skills.core:wrapper:650 - ERROR - An error occurred while processing a request in AVmusic Skill
Traceback (most recent call last):
File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/skills/core.py", line 642, in wrapper
self.settings.store()  # Store settings if they've changed
File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/skills/settings.py", line 546, in store
with open(self._settings_path, 'w') as f:
PermissionError: [Errno 13] Permission denied: '/opt/mycroft/skills/reginaneon-av-music.reginaneon/settings.json'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants