Error running as non-root user #51

Closed
opened 2018-01-12 11:35:09 +00:00 by eugenevd · 6 comments

I logged this as a separate issue (than #50) as it's not exactly the same.

I've installed borgmatic:

sudo -H pip3 install borgmatic

Running as root works fine. But, a non root user results in this error:

user@host:~$ borgmatic
Traceback (most recent call last):
File "/usr/local/bin/borgmatic", line 7, in
from borgmatic.commands.borgmatic import main
File "/usr/local/lib/python3.5/dist-packages/borgmatic/commands/borgmatic.py", line 10, in
from borgmatic.config import collect, convert, validate
File "/usr/local/lib/python3.5/dist-packages/borgmatic/config/convert.py", line 3, in
from ruamel import yaml
ImportError: cannot import name 'yaml'

Thanks

I logged this as a separate issue (than #50) as it's not exactly the same. I've installed borgmatic: sudo -H pip3 install borgmatic Running as root works fine. But, a non root user results in this error: user@host:~$ borgmatic Traceback (most recent call last): File "/usr/local/bin/borgmatic", line 7, in <module> from borgmatic.commands.borgmatic import main File "/usr/local/lib/python3.5/dist-packages/borgmatic/commands/borgmatic.py", line 10, in <module> from borgmatic.config import collect, convert, validate File "/usr/local/lib/python3.5/dist-packages/borgmatic/config/convert.py", line 3, in <module> from ruamel import yaml ImportError: cannot import name 'yaml' Thanks
Author

apologies, the formatting came out wrong. this interface doesn't allow me to edit? :(

apologies, the formatting came out wrong. this interface doesn't allow me to edit? :(
Owner

Do you know what version of ruamel.yaml you have installed? This should show you: pip show ruamel.yaml

As for comment editing.. There's no pencil icon for you in the upper right of the comment header?

Do you know what version of `ruamel.yaml` you have installed? This should show you: `pip show ruamel.yaml` As for comment editing.. There's no pencil icon for you in the upper right of the comment header?
witten added the
question / support
label 2018-01-15 00:03:11 +00:00
Author
user@machine:~/repo/github$ pip show ruamel.yaml

user@machine:~/repo/github$ sudo -H !!

sudo -H pip show ruamel.yaml
[sudo] password for user:
Name: ruamel.yaml
Version: 0.15.0
Summary: ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order
Home-page: https://bitbucket.org/ruamel/yaml
Author: Anthon van der Neut
Author-email: a.van.der.neut@ruamel.eu
License: MIT license
Location: /usr/local/lib/python3.5/dist-packages
Requires:

--
wrt editing, I have to click the pencil twice for the post to become editable, and then when I click cancel/save nothing happens (both in chrome and firefox)

``` user@machine:~/repo/github$ pip show ruamel.yaml user@machine:~/repo/github$ sudo -H !! sudo -H pip show ruamel.yaml [sudo] password for user: Name: ruamel.yaml Version: 0.15.0 Summary: ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order Home-page: https://bitbucket.org/ruamel/yaml Author: Anthon van der Neut Author-email: a.van.der.neut@ruamel.eu License: MIT license Location: /usr/local/lib/python3.5/dist-packages Requires: ``` -- wrt editing, I have to click the pencil twice for the post to become editable, and then when I click cancel/save nothing happens (both in chrome and firefox)
Owner

Interesting.. I've never seen a system-level Python package that's available as root but not as a user.

For instance, this the output for a non-root user on one of my systems:

$ pip3 show ruamel.yaml 
---
Name: ruamel.yaml
Version: 0.15.0
Location: /usr/local/lib/python3.4/dist-packages
Requires: 
$ which pip3
/usr/bin/pip3

Are you sure that pip resolves to the same thing for each user? For instance, does which pip yield the same path for both root and for your non-root user? Is it possible that one of them resolves to Python 2 instead of 3? You could try pip3 instead.

As for editing comments, I'm not sure what's going on there. Might be a Gitea bug. If you want to debug that further, let me know what versions of Chrome/Firefox you're using, whether you see any JavaScript errors in your console, what add-ons you have enabled, etc.

Interesting.. I've never seen a system-level Python package that's available as root but not as a user. For instance, this the output for a non-root user on one of my systems: ``` $ pip3 show ruamel.yaml --- Name: ruamel.yaml Version: 0.15.0 Location: /usr/local/lib/python3.4/dist-packages Requires: $ which pip3 /usr/bin/pip3 ``` Are you sure that `pip` resolves to the same thing for each user? For instance, does `which pip` yield the same path for both root and for your non-root user? Is it possible that one of them resolves to Python 2 instead of 3? You could try `pip3` instead. As for editing comments, I'm not sure what's going on there. Might be a Gitea bug. If you want to debug that further, let me know what versions of Chrome/Firefox you're using, whether you see any JavaScript errors in your console, what add-ons you have enabled, etc.
Author

I created a new VM and redid the installation.
All well. Not sure what's up with the other two machines' installations then :(
Unfortunately my Python knowledge is next to nothing.

Thanks for the help.

I created a new VM and redid the installation. All well. Not sure what's up with the other two machines' installations then :( Unfortunately my Python knowledge is next to nothing. Thanks for the help.
Owner

Glad to hear it's working now.

Glad to hear it's working now.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#51
No description provided.