Results 1 to 3 of 3

Thread: Python 2.7 application will not run after recent distribution upgrade.

  1. #1

    Default Python 2.7 application will not run after recent distribution upgrade.

    I have been running the PysolFC game since I installed Tumbleweed over a year ago. However recently it has failed to launch.

    When executing from the konsole, it generates the following error.

    spcwh2@linux-xmhl:~> pysol.py
    Traceback (most recent call last):
    File "/usr/bin/pysol.py", line 29, in <module>
    from pysollib.main import main
    File "/usr/lib/python2.7/site-packages/pysollib/main.py", line 31, in <module>
    from util import DataLoader
    File "/usr/lib/python2.7/site-packages/pysollib/util.py", line 53, in <module>
    from mfxutil import Image
    File "/usr/lib/python2.7/site-packages/pysollib/mfxutil.py", line 44, in <module>
    import Image
    File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 27, in <module>
    from . import VERSION, PILLOW_VERSION, _plugins
    ValueError: Attempted relative import in non-package

    I've waited for a week or two before posting this to see if the updates to Tumbleweed would resolve this issue. However it persists.

    Any help would be appreciated.
    Chuck Haatvedt (learning linux)

    Opensuse Tumbleweed / Windows 10 dual boot
    Opensuse Tumbleweed in VMWARE Player

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,487
    Blog Entries
    15

    Default Re: Python 2.7 application will not run after recent distribution upgrade.

    Hi
    I see the Fedora package has a PIL patch, unfortunately since OBS is maintenance mode can't branch, patch and test the fix....

    As root user manually edit /usr/lib/python2.7/site-packages/pysollib/mfxutil.py and add from PIL to the import lines starting down at line 44;

    Code:
    --- PySolFC-2.0.orig/pysollib/mfxutil.py
    +++ PySolFC-2.0/pysollib/mfxutil.py
    @@ -41,18 +41,18 @@ from settings import PACKAGE, TOOLKIT
     Image = ImageTk = ImageOps = None
     if TOOLKIT == 'tk':
         try: # PIL
    -        import Image
    -        import ImageTk
    -        import ImageOps
    +        from PIL import Image
    +        from PIL import ImageTk
    +        from PIL import ImageOps
         except ImportError:
             Image = None
         else:
             # for py2exe
    -        import GifImagePlugin
    -        import PngImagePlugin
    -        import JpegImagePlugin
    -        import BmpImagePlugin
    -        import PpmImagePlugin
    +        from PIL import GifImagePlugin
    +        from PIL import PngImagePlugin
    +        from PIL import JpegImagePlugin
    +        from PIL import BmpImagePlugin
    +        from PIL import PpmImagePlugin
             Image._initialized = 2
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: Python 2.7 application will not run after recent distribution upgrade.

    Thanks Malcom, it is working now.


    Quote Originally Posted by malcolmlewis View Post
    Hi
    I see the Fedora package has a PIL patch, unfortunately since OBS is maintenance mode can't branch, patch and test the fix....

    As root user manually edit /usr/lib/python2.7/site-packages/pysollib/mfxutil.py and add from PIL to the import lines starting down at line 44;

    Code:
    --- PySolFC-2.0.orig/pysollib/mfxutil.py
    +++ PySolFC-2.0/pysollib/mfxutil.py
    @@ -41,18 +41,18 @@ from settings import PACKAGE, TOOLKIT
     Image = ImageTk = ImageOps = None
     if TOOLKIT == 'tk':
         try: # PIL
    -        import Image
    -        import ImageTk
    -        import ImageOps
    +        from PIL import Image
    +        from PIL import ImageTk
    +        from PIL import ImageOps
         except ImportError:
             Image = None
         else:
             # for py2exe
    -        import GifImagePlugin
    -        import PngImagePlugin
    -        import JpegImagePlugin
    -        import BmpImagePlugin
    -        import PpmImagePlugin
    +        from PIL import GifImagePlugin
    +        from PIL import PngImagePlugin
    +        from PIL import JpegImagePlugin
    +        from PIL import BmpImagePlugin
    +        from PIL import PpmImagePlugin
             Image._initialized = 2
    Chuck Haatvedt (learning linux)

    Opensuse Tumbleweed / Windows 10 dual boot
    Opensuse Tumbleweed in VMWARE Player

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •