Cai_the_Pie
Cai_the_Pie

Reputation: 1

How come I cannot get this .EXE to work with pyinstaller?

I am trying to just play around with Pycharm and Pyinstaller as I am very new to python and am trying to create a .exe file that simply displays a chunk of parented html from a website, just to test. I got it to work within Pycharm but when I run it as an exe, it just opens and closes a blank console. I created the exe using:

pyinstaller.exe --onefile --windowed main.py

(main is the file name).

Here is the code:

from bs4 import BeautifulSoup
import requests

Url = "https://www.premierleague.com/players/5178/Mohamed-Salah/stats"
DisplayText = ""

Request = requests.get(Url)
Htmlcode = BeautifulSoup(Request.text, "html.parser")
search = Htmlcode.findAll(text="Goals   ")
narrow = search[0].parent

input(narrow)

also I think, but I am not sure, windows security may be screwing with this but I am not sure.

Upvotes: 0

Views: 486

Answers (1)

Aceinfurno
Aceinfurno

Reputation: 36

Try running as pyinstaller instead of pyinstaller.exe, and unless it's a typo check the last line of code, ''' after the input(narrow) would cause an error

EDIT: run as

pyinstaller --onefile yourFile.py

without the --windowed, there's no need for the --windowed tag and that's what's causing the error

Upvotes: 1

Related Questions