Skip to content Skip to sidebar Skip to footer

Getting A Valueerror: Invalid Literal For Int() With Base 10: '' Error And Don't Know Why

I know this has been asked before, but for my circumstance, I can't seem to figure out why this is being thrown When I try to run my calculations, I am given this error from my con

Solution 1:

The int() function is throwing an exception because you are trying to convert something that is not a number.

I suggest that you might consider using debugging print statements to find out what plan's and fiid's are initally and how they change.

Another thing you can do is wrap the call to int() using try/catch

val='a'try:
    int_val = int(val)
except ValueError:
    print("Failure w/ value " + val)

Solution 2:

Somewhere in that chain of calls, you're passing an empty string which the code is then trying to convert to an integer. Log your input at the time to track it down.

Solution 3:

Suggest you look at the values of plan and fiid, because either plan or fiid is not set to the value that you think.

Solution 4:

For me, I had to delete the migration folder and follow the steps in the top answer in this link and then re-run the migrations, and then the error went away and it worked.

Post a Comment for "Getting A Valueerror: Invalid Literal For Int() With Base 10: '' Error And Don't Know Why"