Syntax error also push to heroku yeilds language unrecognized could not auto detect language

im adding the whole code. when i run it i started getting a syntax error although when i first coded it i received no such error. Also when i try to push to heroku i get language not detected so i added a python build packet for language detection and still recieved the same error i am re writing the code by hand now although i tried to copya and past also tried comman git puch heroku HEAD:master and git heroku push HEAD:main and both did not work although i did get heroku push to work it put it on master branch and did not install the necessies to make it work remotely. i am building a python binance webhook bot

here is the code
mport json, config
from flask import Flask, request,jsonify
from binance.client import Client
from binance.enums import *

app = Flask(name)

client = Client(config.API_KEY, config.API_SECRET, tld=‘us’)

def order(side, quantity, symbol,order_type=ORDER_TYPE_MARKET):
try:
print(f"sending order {order_type} - {side} {quantity} {symbol}" )
order = client.create_order(symbol=symbol, side=side, type=order_type, quantity=quantity)
except Exception as e:
print(“an exception occured - {}”.format(e))
return False

return order

@app.route(’/’)
def hello_world():
return ‘Hello, World!’

@app.route(’/webhook’, methods=[‘POST’])
def webhook():
#print(request.data)
data = json.loads(request.data)

if data["passphrase"] != config.WEBHOOK_PASSPHRASE:
   return {
       "code": "error",
      "message": "Nice try, invalid passphrase"
    }
print(data['ticker'])
print(data['bar'])

side = data['strategy']['order_action'].upper()
quantity = data['strategy']['order_contracts']
order_response = order(side, quantity, "BTCUSD")

if order_response:
     return {
        "code": "success",
        "message": "order executed"
    }
else: 
    print("order failed")
    return {
        "code": "error",
        "message": "order failed"
    }

that is the entire bot outside the file containing api and password information

also i get
binance.client import Client, AsyncClient # noqa as a post in terminal after i remade the python bot

also i have been getting a line 118 syntax issue when i tried to rebuild the bot it did not even work this time it worked 2 days ago

File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/dateutil/relativedelta.py”, line 118
raise TypeError, “relativedelta only diffs datetime/date”
^
SyntaxError: invalid syntax

By Natronix M via Discussions on Python.org at 22Mar2022 02:00:

also i have been getting a line 118 syntax issue when i tried to
rebuild the bot it did not even work this time it worked 2 days ago

File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/dateutil/relativedelta.py”, line 118
raise TypeError, “relativedelta only diffs datetime/date”
^
SyntaxError: invalid syntax

The modern syntax is:

raise TypeError("relativedelta only diffs datetime/date")

which creates a new instance of TypeError (like any other object
creation) to be raised.

But I see that this is from the dateutil library, not your own code. I
think that is not correctly installed - you’re using Python 3.9 but that
is Python 2 code, probably very old. The current version of that library
creates the TypeError correctly:

if dt1 and dt2:
    # datetime is a subclass of date. So both must be date
    if not (isinstance(dt1, datetime.date) and
            isinstance(dt2, datetime.date)):
        raise TypeError("relativedelta only diffs datetime/date")

How did you install dateutil? I would not normally expect this.

Anyway, please show the full traceback, not just the bottom. The bottom
shows where things blew up, but the full traceback shows where that
problem came from.

Cheers,
Cameron Simpson cs@cskk.id.au

will do i wll be back to edit and put in a trace back

i closed down the terminal so i dont know if i can get a traceback until i rebuild the entire bot from mostly scratch i have memorized part of the process by now so it should be easy.

Why don’t you save your code in a .py file instead of having to retype it from scratch each time?

Otherwise each time you retype it, you will have a new set of typos and bugs.

By Natronix M via Discussions on Python.org at 23Mar2022 00:13:

will do i wll be back to edit and put in a trace back

Please just make an additional post in this topic instead. Those of us
on email do not see revised/edited posts. Thanks, Cameron