multibootusb
multibootusb copied to clipboard
Unable to start: Config is not defined
I have tried the latest version, 9.1.0, and I get the following error:
Traceback (most recent call last): File "/usr/local/bin/multibootusb", line 174, in <module> if config.debug is True: NameError: name 'config' is not defined
So, I tried an earlier version, 8.9.0, yet I still get the same error, just on a different line:
Traceback (most recent call last): File "/usr/local/bin/multibootusb", line 164, in <module> if config.debug is True: NameError: name 'config' is not defined
I am using Ubuntu 16.04 and installed both versions using the install.py script. I originally tried installing using the deb package, but the install failed and I don't have the error now.
Don't install using install.py. Remove the old install and try running directly from source.
On 15-Jan-2018 2:18 AM, "Tony Langworthy" [email protected] wrote:
I have tried the latest version, 9.1.0, and I get the following error: Traceback (most recent call last): File "/usr/local/bin/multibootusb", line 174, in
if config.debug is True: NameError: name 'config' is not defined So, I tried an earlier version, 8.9.0, yet I still get the same error, just on a different line: Traceback (most recent call last): File "/usr/local/bin/multibootusb", line 164, in
if config.debug is True: NameError: name 'config' is not defined I am using Ubuntu 16.04 and installed both versions using the install.py script. I originally tried installing using the deb package, but the install failed and I don't have the error now.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mbusb/multibootusb/issues/253, or mute the thread https://github.com/notifications/unsubscribe-auth/AEC34HZydXjVVsifK97M4LP2HLd2I8UGks5tKmgngaJpZM4Rdu0_ .
I'm still not able to run it. I'm getting
Traceback (most recent call last): File "./multibootusb", line 174, in <module> if config.debug is True: NameError: name 'config' is not defined
when I run ./multibootusb from the root of the source folder.
Did you prefix python3 before multibootusb?
On 15-Jan-2018 6:56 AM, "Tony Langworthy" [email protected] wrote:
I'm still not able to run it. I'm getting
Traceback (most recent call last): File "./multibootusb", line 174, in
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/mbusb/multibootusb/issues/253#issuecomment-357560933, or mute the thread https://github.com/notifications/unsubscribe-auth/AEC34IxAKKK2Yb-gMs66wgx6-CHSrcEvks5tKqkygaJpZM4Rdu0_ .
I just tried that. Same error, although my version of python is 2.7.12
I do have version 3.5 of python installed on the system and I'm still getting the same error when I run the command with like this:
python3 ./multibootusb
What do you see in /usr/lib/python3/dist-packages/scripts/
? I still believe that you have installed multibootusb in python2.7. You need to remove old install before trying the new method.
I only show 1 directory, __pycache__,
in /usr/lib/python3/dist-packages/scripts
I've tried running it from the source directory, and I get the same error:
tyil@krata:~/downloads/firefox/multibootusb-9.2.0 » python3 multibootusb -d
Using python version 3.6.1 (default, Dec 31 2017, 01:41:48)
[GCC 5.4.0] on platform Linux-4.14.12-2-x86_64-Intel-R-_Core-TM-_i7-4700MQ_CPU_@_2.40GHz-with-gentoo-2.2.1
Traceback (most recent call last):
File "multibootusb", line 170, in <module>
config.debug = True
NameError: name 'config' is not defined
Try applying the following patch and see if you get more info.
diff --git a/multibootusb b/multibootusb
index 0520028..4aaee9c 100644
--- a/multibootusb
+++ b/multibootusb
@@ -34,12 +34,15 @@ try:
from scripts import gen
from scripts import config
except:
+ import traceback
+ traceback.print_exc()
try:
from .scripts.mbusb_cli import *
from .scripts import admin
from .scripts import gen
from .scripts import config
except:
+ traceback.print_exc()
import scripts
gui = True
Output of python3 multibootusb
with the patch you supplied:
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.UDisks2': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tyil/downloads/firefox/multibootusb-9.2.0/scripts/udisks.py", line 94, in __init__
'/org/freedesktop/UDisks2')
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib64/python3.6/site-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UDisks2 was not provided by any .service files
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tyil/downloads/firefox/multibootusb-9.2.0/scripts/udisks.py", line 174, in get_udisks
u = UDisks2()
File "/home/tyil/downloads/firefox/multibootusb-9.2.0/scripts/udisks.py", line 97, in __init__
raise NoUDisks2()
scripts.udisks.NoUDisks2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.UDisks': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tyil/downloads/firefox/multibootusb-9.2.0/scripts/udisks.py", line 42, in __init__
'/org/freedesktop/UDisks'), 'org.freedesktop.UDisks')
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib64/python3.6/site-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UDisks was not provided by any .service files
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "multibootusb", line 32, in <module>
from scripts.mbusb_cli import *
File "/home/tyil/downloads/firefox/multibootusb-9.2.0/scripts/mbusb_cli.py", line 12, in <module>
from . import usb
File "/home/tyil/downloads/firefox/multibootusb-9.2.0/scripts/usb.py", line 20, in <module>
UDISKS = udisks.get_udisks(ver=None)
File "/home/tyil/downloads/firefox/multibootusb-9.2.0/scripts/udisks.py", line 176, in get_udisks
u = UDisks()
File "/home/tyil/downloads/firefox/multibootusb-9.2.0/scripts/udisks.py", line 45, in __init__
raise NoUDisks1()
scripts.udisks.NoUDisks1
Traceback (most recent call last):
File "multibootusb", line 40, in <module>
from .scripts.mbusb_cli import *
ModuleNotFoundError: No module named '__main__.scripts'; '__main__' is not a package
Using python version 3.6.1 (default, Dec 31 2017, 01:41:48)
[GCC 5.4.0] on platform Linux-4.14.12-2-x86_64-Intel-R-_Core-TM-_i7-4700MQ_CPU_@_2.40GHz-with-gentoo-2.2.1
Traceback (most recent call last):
File "multibootusb", line 190, in <module>
if config.debug is True:
NameError: name 'config' is not defined
What is your host OS and DE that you are running mbusb under? Any relevant info in /var/log/{syslog|messages} or from journalctl? And is the service, either udisks or udisks2 running?
Some how the python import is not working for you. Could you please tell us the name of distro?
What is your host OS
Funtoo GNU+Linux.
and DE
I seriously doubt this would matter, but it's XMonad.
Any relevant info in /var/log/{syslog|messages}
No.
And is the service, either udisks or udisks2 running?
No. udisks
isn't installed either.
No. udisks isn't installed either.
I think this is the cause of the error since mbusb uses udisksd through dbus to mount the target usb device and the interface is probed during module loading by the following statement
UDISKS = udisks.get_udisks(ver=None)
in scripts/usb.py. Will you enable either of the udisks services, preferably udisks2, and see if the problem goes away though setup may not be trivial? (https://wiki.gentoo.org/wiki/Udisks)
I think this is the cause of the error since mbusb uses udisksd through dbus to mount the target usb device and the interface is probed during module loading by the following statement
This is not mentioned as a dependency. Additionally, the supposed error reporting is very LTA.
I was originally looking for something small and simple to accomplish a reasonable task, but now it seems this project isn't the solution for me.
is this problem solved? i meet this problem too.
I also get this error when I install from source on Arch Linux (Linux-4.16.5-1-ARCH-x86_64-with-arch) with i3wm and Python 3.6.5-2 .
sudo multibootusb
and sudo python3 /bin/multibootusb
result in:
Using python version 3.6.5 (default, Apr 14 2018, 13:17:30)
[GCC 7.3.1 20180406] on platform Linux-4.16.5-1-ARCH-x86_64-with-arch
Traceback (most recent call last):
File "/usr/bin/multibootusb", line 187, in <module>
if config.debug is True:
NameError: name 'config' is not defined
pacman -Q| grep py
pyalpm 0.8.2-2
pygobject-devel 3.28.2-1
pygobject2-devel 2.28.7-1
pygtk 2.24.0-8
pyqt5-common 5.10.1-2
python 3.6.5-2
python-appdirs 1.4.3-1
python-chardet 3.0.4-1
python-dbus 1.2.6-1
python-dbus-common 1.2.6-1
python-decorator 4.3.0-1
python-gobject 3.28.2-1
python-idna 2.6-1
python-packaging 16.8-2
python-pyparsing 2.2.0-1
python-pyqt5 5.10.1-2
python-pyudev 0.21.0-2
python-regex 2018.02.21-1
python-requests 2.18.4-1
python-setuptools 1:39.1.0-1
python-sip 4.19.8-1
python-six 1.11.0-1
python-slip 0.6.5-1
python-urllib3 1.22-1
python2 2.7.14-3
python2-appdirs 1.4.3-1
python2-cairo 1.17.0-1
python2-chardet 3.0.4-1
python2-gobject 3.28.2-1
python2-gobject2 2.28.7-1
python2-idna 2.6-1
python2-ipaddr 2.1.11-1
python2-packaging 16.8-2
python2-pyparsing 2.2.0-1
python2-requests 2.18.4-1
python2-setuptools 1:39.1.0-1
python2-six 1.11.0-1
python2-urllib3 1.22-1
pip freeze
appdirs==1.4.3
aurman==2.9.24
chardet==3.0.4
decorator==4.3.0
enum-compat==0.0.2
i3ipc==1.5.1
idna==2.6
multibootusb==9.2.0
packaging==16.8
pip-autoremove==0.9.0
pipdeptree==0.12.1
pyalpm==0.8
pygobject==3.28.2
pyparsing==2.2.0
pyudev==0.21.0.dev20161225
ranger-fm==1.9.1
regex==2018.2.21
requests==2.18.4
shadowsocks==2.9.1
six==1.11.0
slip==0.6.5
slip.dbus==0.6.5
team==1.0
urllib3==1.22
Please apply the patch shown above or use devel branch on github and examine the traceback. If you get the same traceback as shown above, you'll have to tweak OS configuration so that disks can be mounted/umounted by udisks/udisks2 daemon through dbus interface. I don't know yet exact configuration steps you should take though. It seems udisk/disks2 is enabled by default in many distros.
Thanks for the help! I ran:
git clone https://github.com/mbusb/multibootusb
cd multibootusb
git branch devel
git checkout devel
sudo python3 install.py
sudo multibootusb
However it still outputs:
Using python version 3.6.5 (default, Apr 14 2018, 13:17:30)
[GCC 7.3.1 20180406] on platform Linux-4.16.5-1-ARCH-x86_64-with-arch
Traceback (most recent call last):
File "/usr/bin/multibootusb", line 187, in <module>
if config.debug is True:
NameError: name 'config' is not defined
Let me know if i missed a step. It looks like my Arch install did not have udisk2 installed. I installed it and started the daemon, but alas i am getting the same error.
Please don't install. Remove the install and execute run directly from source and check if the issue persist.
On Thu 3 May, 2018, 11:12 AM Tyler Wilbers, [email protected] wrote:
Thanks for the help! I ran: git clone https://github.com/mbusb/multibootusb cd multibootusb git branch devel git checkout devel sudo python3 install.py sudo multibootusb
However it still outputs:
Using python version 3.6.5 (default, Apr 14 2018, 13:17:30) [GCC 7.3.1 20180406] on platform Linux-4.16.5-1-ARCH-x86_64-with-arch Traceback (most recent call last): File "/usr/bin/multibootusb", line 187, in
if config.debug is True: NameError: name 'config' is not defined Let me know if i missed a step. It looks like my Arch install did not have udisk2 installed. I installed it and started the daemon, but alas i am getting the same error.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mbusb/multibootusb/issues/253#issuecomment-386196309, or mute the thread https://github.com/notifications/unsubscribe-auth/AEC34L1-bQbEJCG8GmiqEvRtWl72Y2Aiks5tupi-gaJpZM4Rdu0_ .
Please verify that ImportError is caught at the beginning of multibootusb script. Then instead of
sudo multibootusb
does
sudo ./multibootusb
or
sudo python3 multibootusb
make difference? (Even if either of these works, you are still advised to remove previous installations.)
@shinji-s which "many distros" are you talking about? It's not enabled in any of the OSs I'm using, which include Funtoo, Archlinux, Ubuntu and FreeBSD.
Judging from the amount of issues raised about mbusb not starting and of those about unexpected behavior after it has started, it seems to me that many distros have udisks enabled. I'm running mbusb on Ubuntu 16.04.4 and debian 9 without explicitly installing/enabling udisks. According the author, neither Fedora or Suse in addition to a debian did not exhibit the problem.
I just double-checked my (only) Ubuntu box, which is at 16.04.4, and it does not contain udisks. It feels like it just gets pulled in as a dependency for many people, but is not enabled as a default.
It's also not referred to in the documentation about dependencies, which it should, no matter if it's a default on some rare distros or not. Additionally, the error it shows is unrelated to what is actually amiss and seems to bring more confusion than actually aiding the user to solve it.
It feels like it just gets pulled in as a dependency for many people, but is not enabled as a default.
That is likely. I'll check next time I have chance to do clean installation.
Additionally, the error it shows is unrelated to what is actually amiss and seems to bring more confusion than actually aiding the user to solve it.
A valid criticism. I appreciate if you try devel branch and see if https://github.com/mbusb/multibootusb/pull/358 correctly address your concern.
Using the devel
branch, the output is as follows:
Using python version 3.6.1 (default, Apr 29 2018, 13:52:48)
[GCC 5.4.0] on platform Linux-4.14.12-2-x86_64-Intel-R-_Core-TM-_i7-4700MQ_CPU_@_2.40GHz-with-gentoo-2.2.2
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.UDisks2': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tyil/downloads/firefox/multibootusb/scripts/udisks.py", line 91, in __init__
'/org/freedesktop/UDisks2')
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib64/python3.6/site-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UDisks2 was not provided by any .service files
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tyil/downloads/firefox/multibootusb/scripts/udisks.py", line 167, in get_udisks
u = UDisks2()
File "/home/tyil/downloads/firefox/multibootusb/scripts/udisks.py", line 94, in __init__
raise NoUDisks2()
scripts.udisks.NoUDisks2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.UDisks': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tyil/downloads/firefox/multibootusb/scripts/udisks.py", line 42, in __init__
'/org/freedesktop/UDisks'), 'org.freedesktop.UDisks')
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib64/python3.6/site-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib64/python3.6/site-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UDisks was not provided by any .service files
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "multibootusb", line 32, in <module>
from scripts.mbusb_cli import *
File "/home/tyil/downloads/firefox/multibootusb/scripts/mbusb_cli.py", line 12, in <module>
from . import usb
File "/home/tyil/downloads/firefox/multibootusb/scripts/usb.py", line 25, in <module>
UDISKS = udisks.get_udisks(ver=None)
File "/home/tyil/downloads/firefox/multibootusb/scripts/udisks.py", line 169, in get_udisks
u = UDisks()
File "/home/tyil/downloads/firefox/multibootusb/scripts/udisks.py", line 45, in __init__
raise NoUDisks1()
scripts.udisks.NoUDisks1
Thank you for trying. It appears the patch is working as expected.
apt-cache rdepends udisks2 shows a lot of packages. I'll see which one(s) of them I have installed.
ubuntu-desktop recommends => gnome-disk-utility dpends on => gnome-udisks2 So installing ubuntu-desktop pulls in udisks2, does not it?
root@K553:~# apt-cache rdepends udisks2 | egrep "^ [a-z]" | awk '{$1=$1;print}' | LANG=C xargs dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
rc dbus-user-sess 1.10.6-1ubun all simple interprocess messaging sys
ii gnome-disk-uti 3.18.3.1-1ub amd64 manage and configure disk drives
ii gparted 0.25.0-1 amd64 GNOME partition editor
ii gvfs-daemons 1.28.2-1ubun amd64 userspace virtual filesystem - se
ii python3-checkb 0.22-1 all collection of Python modules used
ii usb-creator-co 0.3.2 amd64 create a startup disk using a CD
dpkg-query: no packages found matching cockpit-storaged
... rest deleted
@Patrick Spek Could you tell me the way you have installed multibootusb? Is it using the install script provided with multibootusb or binaries like deb / rpm?
On Thu 3 May, 2018, 2:55 PM Shinji Suzuki, [email protected] wrote:
ubuntu-desktop recommends => gnome-disk-utility dpends on => gnome-udisks2 So installing ubuntu-desktop pulls in udisks2, does not it?
root@K553:~# apt-cache rdepends udisks2 | egrep "^ [a-z]" | awk '{$1=$1;print}' | LANG=C xargs dpkg -l Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= rc dbus-user-sess 1.10.6-1ubun all simple interprocess messaging sys ii gnome-disk-uti 3.18.3.1-1ub amd64 manage and configure disk drives ii gparted 0.25.0-1 amd64 GNOME partition editor ii gvfs-daemons 1.28.2-1ubun amd64 userspace virtual filesystem - se ii python3-checkb 0.22-1 all collection of Python modules used ii usb-creator-co 0.3.2 amd64 create a startup disk using a CD dpkg-query: no packages found matching cockpit-storaged ... rest deleted
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mbusb/multibootusb/issues/253#issuecomment-386238139, or mute the thread https://github.com/notifications/unsubscribe-auth/AEC34FoCWYpVUCdamtYrLFYFzmV9Wea2ks5tus0dgaJpZM4Rdu0_ .
I ran from source but having the same issue as before (NameError: name 'config' is not defined
):
git clone https://github.com/mbusb/multibootusb
cd multibootusb
git branch devel
git checkout devel
Change release and pyinstall directory (/usr/bin/pyinstall)
sudo python3 build_pkg run