Import error for Oauth

后端 未结 1 1974
一整个雨季
一整个雨季 2021-01-18 02:13

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

相关标签:
1条回答
  • 2021-01-18 02:26

    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>
    
    0 讨论(0)
提交回复
热议问题