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 "<string>", line 1, in <module>
      File "/tmp/pip-req-build-xzyoskf5/setup.py", line 11, in <module>
        from solaar import NAME, __version__
    ModuleNotFoundError: No module named 'solaar'
This commit is contained in:
Markus Heiser 2018-09-02 11:00:38 +02:00 committed by Peter Wu
parent a66121db0d
commit ab4226e066
1 changed files with 4 additions and 1 deletions

View File

@ -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: