#๐Ÿ”’ how do i fix this

85 messages ยท Page 1 of 1 (latest)

pallid tideBOT
#

@earnest venture

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

earnest venture
#

how do i fix this Syntax error in
File "C:\Users\fwvex\AppData\Local\Programs\Python\Python312\Lib\tokenize.py", line 368, in find_cookie
raise SyntaxError(msg)
SyntaxError: unknown encoding: future_fstrings

gray bluff
earnest venture
#

im trying to make

#

my py

#

into a exe

#

but its not working

#

it keeps saying that

#

@gray bluff

gray bluff
#

What tool are you using to bundle your script into an exe?

earnest venture
#

a moderator bot

#

and im trying to not let people

#

get the src

gray bluff
#

What are you using to make the exe?

earnest venture
#

pyinstaller

#

i did

gray bluff
#

What Python version are you using for PyInstaller? The future_fstrings is something from earlier versions of Python

earnest venture
#

idk

#

how do i heck

#

check

#

3.12

#

im using

cinder pier
earnest venture
#

what

lost ocean
earnest venture
#

bro

scenic ice
#

We asked you several times at this point to stop asking for help with this.

earnest venture
#

for what

#

ITS NOT THE ROTATOR

scenic ice
#

Okay, then can we see all of your code, and a full traceback?

earnest venture
#

i dont wanna leak my code

scenic ice
#

Well, you're gonna have a hard time getting help if you don't

#

What about the full traceback then?

earnest venture
#

idk what that even is

scenic ice
earnest venture
#

oooo

scenic ice
#

There's likely more errors than what you posted there

earnest venture
#

thats the only one

#

it said

scenic ice
#

Huh. Well, then I really don't know what to tell you

#

Unless we can see the source code, it could be anything

#

All we know for sure is that on line 368, something ain't encoding correctly

earnest venture
#

theres not even

#

a line 368

scenic ice
#

in the tokenize.py file

#

there is

#

in your file, maybe not

earnest venture
#

it doesnt

scenic ice
#

No, that's a file in the standard library

earnest venture
#

'i launch that

#

it says this

#

how do i fix the tokenize file

scenic ice
#

you don't

#

your file is the issue

#

tokenize.py is doing its best

earnest venture
#

i wdid

#

the exe

#

before doing the code

#

and it worked like a charm

#

so idk whats going on now

gray bluff
#

future_fstrings is a backport of f-strings to Pyton <3.6
You are using 3.12, so you should not need the package or the encoding. I would check if PyInstaller is configured for the correct version

pallid tideBOT
#

Lib/tokenize.py line 368

raise SyntaxError(msg)```
earnest venture
#

so

#

how could i fix it

lost ocean
#

!traceback

pallid tideBOT
#
Traceback

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
        ~~~~^~~
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

gray bluff
#

I would check what if you are using the PyInstaller that you think you are.
What shows up if you do this: py -m pip list

earnest venture
#

ok

#

pyinstall 0.1.4
pyinstaller 6.5.0
pyinstaller-hooks-contrib 2024.3

gray bluff
#

If you use the command py -m PyInstaller main.py --onefile, does that produce the same error?

earnest venture
#

klemme test

gray bluff
#

You did not include the py portion of the py -m ...

earnest venture
#

wdym

#

i did

#

Syntax error in C:\Users\fwvex\Documents\modbot\modbot2d\main.py
^^^^^^^^^^^^^^^^^^
File "C:\Users\fwvex\AppData\Local\Programs\Python\Python312\Lib\tokenize.py", line 368, in find_cookie
raise SyntaxError(msg)
SyntaxError: unknown encoding: future_fstrings

C:\Users\fwvex\Documents\modbot\modbot2d>

#

i gtg

#

be back soon

pallid tideBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.