From ab4226e066d00ce2217e87b80b9978190ce4e389 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 2 Sep 2018 11:00:38 +0200 Subject: [PATCH] setup.py: fix ModuleNotFoundError: No module named 'solaar' Fix the "chicken or the egg" problem: while installing solaar, setup.py tries to import solaar. This will only work if solaar already is installed before. On first time installation a import exception is raised.:: $ pip install git+https://github.com/pwr/Solaar.git Collecting git+https://github.com/pwr/Solaar.git Cloning https://github.com/pwr/Solaar.git to /tmp/pip-req-build-xzyoskf5 Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-req-build-xzyoskf5/setup.py", line 11, in from solaar import NAME, __version__ ModuleNotFoundError: No module named 'solaar' --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fc8bf4c1..465c103f 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,10 @@ autostart_path = '/etc/xdg/autostart' import sys backup_path_0 = sys.path[0] sys.path[0] = backup_path_0 + '/lib' -from solaar import NAME, __version__ +#from solaar import NAME, __version__ +__version__ = '0.9.2' +NAME = 'Solaar' + sys.path[0] = backup_path_0 if 'install' in sys.argv: