I am using Python on windows having working the same code it was working fine now it has suddent change for the updating the programme I found the error
Check your installed requests
version.
requests.utils.to_native_string
is available since requests 2.0.0
.
Upgrading requests
to latest version will solve your problem.
C:\Users\falsetru>pip install requests==1.2.3
Downloading/unpacking requests==1.2.3
...
Successfully installed requests
Cleaning up...
C:\Users\falsetru>python -c "from requests.utils import to_native_string"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name to_native_string
C:\Users\falsetru>pip uninstall -y requests
Uninstalling requests:
Successfully uninstalled requests
C:\Users\falsetru>pip install requests==2.0.0
Downloading/unpacking requests==2.0.0
...
Successfully installed requests
Cleaning up...
C:\Users\falsetru>python -c "from requests.utils import to_native_string"
C:\Users\falsetru>