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

Cannot run pip with sudo #1075

Closed
dragondgold opened this issue Sep 28, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@dragondgold
Copy link
Contributor

commented Sep 28, 2015

  1. What were you doing?

Modifying config.yaml in order to change the default pip command to sudo /usr/bin/pip2 as stated in the docs here: https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager#configuring-the-plugin

  1. What did you expect to happen?

To be able to install new plugins using the plugin manager because I need sudo in order to do it.

  1. What happened instead?

The plugin manager is not able to detect pip. If I use pip: '/usr/bin/pip2' then pip is detected, but when using pip: 'sudo /usr/bin/pip2' it's not. I see in the log (attached below) that there is an OSError: [Errno 13] Permission denied but I don't know what permission is referring to, I already edited the sudoers file to allow running pip2 without password.

  1. Branch & Commit or Version of OctoPrint:

Latest devel branch as 28 September of 2015

  1. Printer model & used firmware incl. version
    (if applicable - always include if unsure):

M3D Micro with M3D-Fio plugin for Octoprint

  1. Browser and Version of Browser, Operating
    System running Browser (if applicable - always
    include if unsure):

Chrome 46.0.2490.33 beta (64-bit) on OS X Yosemite 10.10.5

  1. Link to octoprint.log on gist.github.com or pastebin.com
    (ALWAYS INCLUDE AND DO NOT TRUNCATE):

http://pastebin.com/zapTMVWk

  1. Link to contents of terminal tab or serial.log on
    gist.github.com or pastebin.com (if applicable - always
    include if unsure or reporting communication issues AND
    DO NOT TRUNCATE):

Just lots of Recv: wait

  1. Link to contents of Javascript console in the browser
    on gist.github.com or pastebin.com or alternatively a
    screenshot (if applicable - always include if unsure
    or reporting UI issues):

http://pastebin.com/CqWX8bFe

  1. Screenshot(s) showing the problem (if applicable - always
    include if unsure or reporting UI issues):

octo-pip

I have read the FAQ.

@foosel

This comment has been minimized.

Copy link
Owner

commented Sep 28, 2015

To be able to install new plugins using the plugin manager because I need sudo in order to do it.

I strongly suggest to switch to using a user-owned virtual environment so that this is NOT necessary. Since plugins can basically contain anything, running their install routines as root might not be the best idea.

That being said, I'll look into fixing the call so that it allows sudo prefixing again (and add a warning that this is a bad idea in the process...)

@dragondgold

This comment has been minimized.

Copy link
Contributor Author

commented Sep 28, 2015

@foosel Thank you! I will use a virtual environment as suggested!

@foosel

This comment has been minimized.

Copy link
Owner

commented Sep 28, 2015

This has now been fixed in devel and maintenance and will be part of 1.2.7.

Big fat warning is in place:

image

@foosel foosel closed this Sep 28, 2015

@foosel

This comment has been minimized.

Copy link
Owner

commented Sep 28, 2015

Let me also add a big thank you for the fully fleshed out bug report :)

@dragondgold

This comment has been minimized.

Copy link
Contributor Author

commented Sep 28, 2015

@foosel thank you for such a great piece of software :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.