close

[Solved] ValueError: not enough values to unpack (expected 4, got 1)

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ValueError: not enough values to unpack (expected 4, got 1) in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ValueError: not enough values to unpack (expected 4, got 1) Error Occurs?

Today I get the following error ValueError: not enough values to unpack (expected 4, got 1) in python.

How To Solve ValueError: not enough values to unpack (expected 4, got 1) Error ?

  1. How To Solve ValueError: not enough values to unpack (expected 4, got 1) Error ?

    To Solve ValueError: not enough values to unpack (expected 4, got 1) Error argv variable contains command line arguments. In your code you expected 4 arguments, but got only 1

  2. ValueError: not enough values to unpack (expected 4, got 1)

    To Solve ValueError: not enough values to unpack (expected 4, got 1) Error argv variable contains command line arguments. In your code you expected 4 arguments, but got only 1

Solution 1

argv variable contains command line arguments. In your code you expected 4 arguments, but got only 1 (first argument always script name). You could configure arguments in pycharm. Go to Run -> Edit Configurations. Then create a new python configuration. And there you could specify Script parameters field. Or you could run your script from command line as mentioned by dnit13.

Solution 2

Run it from the shell like this:

python script.py arg1 arg2 arg3

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read