felipelincoln / albion-blackmarket-arbitrage

a tool for comparing local market prices to the black market in Albion Online
MIT License
33 stars 9 forks source link

Doesn't work on mac #5

Closed ChekhWasTaken closed 1 year ago

ChekhWasTaken commented 4 years ago

Hi,

First of all I would like to thank you for great work! I wanted to download this for mac only to find out that it's packaged only for Win and Linux.

I moved forward and downloaded the sources, to run it from terminal, but apparently mac python and tcl/tk works a bit different: i had a crash when pressed search button.

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "./main.py", line 94, in cmd_search
    img = PhotoImage(file='img/'+item_id+'.png')
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 3545, in __init__
    Image.__init__(self, 'photo', name, cnf, master, **kw)
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 3501, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize data in image file "img/T7_SHOES_PLATE_SET3@1.png"

I've solved this locally by replacing

img = PhotoImage(file='img/'+item_id+'.png')

with

img = ImageTk.PhotoImage(Image.open('img/'+item_id+'.png'))

and importing

from PIL import ImageTk, Image

from python package Pillow.

Hope this helps!

felipelincoln commented 4 years ago

I appreciate your contribution!
I could not predict this issue due to not being able to give MAC support. What I can do is refer to this issue in the README.md in order to give MAC users a hope to run this program as well.
Programmers may be able to follow your steps and get to run the program but I may be a bit hard for non programmer, so it would be good if you could provide us an executable file for this program and attach in here. Can you please do this? :nerd_face:

if so all you have to do is run pyinstaller inside the pipenv environment.

pipenv shell
pyinstaller main.py

then go to the dist/main/ folder and rename the generated executable file

mv main albion-blackmarket-comparison

then compress all the files inside this folder and attach here :cowboy_hat_face:
I am sure all MAC users will thank you :smile:

ChekhWasTaken commented 4 years ago

seems i've messed up something. when i did the steps you mentioned and tried to launch the app, after performing search i'm getting following error:

FileNotFoundError: [Errno 2] No such file or directory: 'items/armor6.txt'

i've tried to move the items, urls and img directories to the dist/main, but still getting the same error

felipelincoln commented 4 years ago

Can you show me the tree for the dist/main directory?