Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.123] Won't start - AttributeError: tobytes #261

Closed
theRealPadster opened this issue Oct 28, 2021 · 5 comments
Closed

[3.123] Won't start - AttributeError: tobytes #261

theRealPadster opened this issue Oct 28, 2021 · 5 comments
Labels

Comments

@theRealPadster
Copy link

Describe the bug
I try and run it and nothing happens. It gives me an error.

Error message

If you make a bug report about this error, please include the contents of the following log file:
/home/padster/.fofix/fofix.log
The log file already includes the traceback given above.
Traceback (most recent call last):
  File "./FoFiX.py", line 276, in <module>
    main()
  File "./FoFiX.py", line 175, in main
    engine = GameEngine(config)
  File "/opt/fofix/src/GameEngine.py", line 597, in __init__
    self.data = Data(self.resource, self.svg)
  File "/opt/fofix/src/Data.py", line 130, in __init__
    self.loadImgDrawing(self, "star1",   os.path.join("themes",themename,"star1.png"), textureSize = (128, 128))
  File "/opt/fofix/src/Data.py", line 583, in loadImgDrawing
    drawing  = self.resource.load(target, name, lambda: ImgDrawing(self.svg, fileName), synch = True)
  File "/opt/fofix/src/Resource.py", line 246, in load
    return l.finish()
  File "/opt/fofix/src/Resource.py", line 113, in load
    self.result = self.function()
  File "/opt/fofix/src/Data.py", line 583, in <lambda>
    drawing  = self.resource.load(target, name, lambda: ImgDrawing(self.svg, fileName), synch = True)
  File "/opt/fofix/src/Svg.py", line 516, in __init__
    self.texture = Texture(ImgData)
  File "/opt/fofix/src/Texture.py", line 66, in __init__
    self.loadFile(name)
  File "/opt/fofix/src/Texture.py", line 70, in loadFile
    self.loadImage(Image.open(name))
  File "/opt/fofix/src/Texture.py", line 77, in loadImage
    string = image.tobytes('raw', 'RGBA', 0, -1)
  File "/usr/lib/python2.7/site-packages/PIL/Image.py", line 512, in __getattr__
    raise AttributeError(name)
AttributeError: tobytes

To Reproduce
Install 3.123-1 from the AUR

Environment (please complete the following information):

  • OS: Arch Linux
  • Python version: [e.g. 2.7.x].
»»»» python --version
Python 3.9.7
»»»» python2 --version 
Python 2.7.18
@Linkid Linkid added this to the 3.124 milestone Nov 13, 2021
@urban-prah
Copy link

'pip2 install Pillow' fixes this but i guess PKGBUILD should be changed

@megustanlosfrijoles
Copy link

'pip2 install Pillow' fixes this but i guess PKGBUILD should be changed

Hi could you help me get this fixed? I also have the same error.

I am trying this, am I doing it wrong? Sorry, I don't know much.

python -m pip install Pillow Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: Pillow in /usr/lib/python3.9/site-packages (8.4.0)

@urban-prah
Copy link

urban-prah commented Nov 17, 2021

Use sudo to install the package system-wide. You should also use python 2.x as the game still requires it. Command 'python' links to version 3.9 on your system.

# sudo python2 -m pip install Pillow

@megustanlosfrijoles
Copy link

Thank you very much. I had to install pip with Python 2, and then add your command. Now it looks like it's working with no problem!

@Linkid
Copy link
Member

Linkid commented Nov 17, 2021

Hi. Thanks @xaidenz ! I've just updated the AUR package fofix. You can update it to get python2-pillow.

https://aur.archlinux.org/cgit/aur.git/commit/PKGBUILD?h=fofix&id=10d71269ab77e9d4467add4b7f65d1bc9e870343

@Linkid Linkid closed this as completed Nov 17, 2021
@Linkid Linkid removed this from the 3.124 milestone Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants