Closed recursiveSlacker closed 4 years ago
Exactly what's happening to me. Downloaded Python, configured everything like should be. But when I drag a picture to the main it opens and closes very fast.
There's something i completely forgot to mention and that is likely the problem. The script requires an external library to work, the certifi
python module is needed for SSL support for connecting with the chat.
You can fix that by running pip install certifi
or if you have different versions of python pip3 install certifi
, note that this might need root privileges on linux. Also make sure you have ssl
module installed by running the same pip command, just with ssl
instead of certifi
, though i believe it is a part of python's core libraries.
Thank you for pointing out this issue, i will implement checks for that kind of stuff. Let me know if that fixes the problem.
If the problem persists please open the command line in the folder with the bot, you can do that by holding shift when right clicking inside the folder, select open CMD here
(something like that), then type in python main.py "path\to\the\image.png"
(use python3
insdtead if multiple versions are installed), the window should show the error instead of closing, paste the output here
I put in cmd pip install certifi
and it seems it worked, but when I do the same with pip install ssl
it errors:
ERROR: Command errored out with exit status 1:
command: 'c:\users\USER\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\USER\\AppData\\Local\\Temp\\pip-install-_e5hbti3\\ssl\\setup.py'"'"'; __file__='"'"'C:\\Users\\USER\\AppData\\Local\\Temp\\pip-install-_e5hbti3\\ssl\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\USER\AppData\Local\Temp\pip-install-_e5hbti3\ssl\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\USER\AppData\Local\Temp\pip-install-_e5hbti3\ssl\setup.py", line 33
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I did open PowerShell window here
and ran your line and here is the output:
Traceback (most recent call last):
File "main.py", line 6, in <module>
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
PS D:\Python\XY_painter_for_twitch-master\XY_painter_for_twitch-master>
I updated the bot, so you might want to download the current version, i added a setup.bat
file, hopefully you can just double-click on that and it'll install needed libraries, that should be all you need.
You can still use the old version if you want, run pip install Pillow
(first letter of 'Pillow' is upper case!), just like you did with 'certifi'. Then it should work
If it still doesn't work, then do 'shift + right click' inside the folder with the bot, click on "open PowerShell window here" and type in python main.py "path\to\the\image.png"
and paste the output here like you did before.
Okay downloaded the new files and it downloaded the Pillow. However it still doesn't work.
Now python main.py "path\to\the\image.png"
simply gives this output:
File does not exist
EDIT: I didn't have # before the channel name. You should add it to the config because it wasn't there.
I'll be sure to add that. So did you actually put "path\to\the\image.png"
in the command? If you want to run it from command line, like you say you did then you'll need the actual path to the image file, if you put it in the folder with the bot you can just use the name of the file. You should also be able to just drag the image onto main.py file
Yeah I did put that line. It worked well after I put # before the channel's name
I downloaded the new version today, configured correctly, ran the batch file, still no luck with dragging the image onto the main.py file or clicking on the main.py file.
You need to have Python in path
You need to have Python in path
How do I do that/what does that mean? I'm not familiar with running programs like this. I might already have that going on.
SyntaxError: invalid syntax
>>> pip install certifi
File "<stdin>", line 1
pip install certifi
^
I'm about ready to just drop the idea of using any program that requires me to construct it from pieces like this. How do you programmer types live like this?
EDIT: I don't know what I did, but it worked. I added a path in the command line and suddenly the setup file does something. That was certainly interesting.
Simple as that. I put in everything in the config that the readme said to, I have python installed (correct version), etc. Yet whenever I drag an image (whether it's dragging the image itself or an image file (png), I tried it all, a command box opens and closes in the span of about a tenth of a second. No time for input.