Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 3.7 import requests returns "Chardet" error

When importing requests in python3, I'm getting the following error:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32
bit  (Intel)] on win32 Type "help", "copyright", "credits" or
"license" for more information
>>>> import requests 
Traceback (most recent call last): File "<stdin>", line 1, in <module> File
"C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests-2.19.1-py3.7.egg\requests\__init__.py", line 44, in <module> 
import chardet 
ModuleNotFoundError: No module named 'chardet'

This is a fresh install, but because of the env I'm working in, I couldn't use pip to install requests. I had to download the source and install via the setup.py install file.

Doing some searches yields some results, but nothing that seems to be a solution for my situation.

Thanks

like image 694
JLarrimore Avatar asked Mar 23 '26 19:03

JLarrimore


1 Answers

Try installing chardet module using this command:

pip3 install chardet
like image 110
user12240555 Avatar answered Mar 25 '26 09:03

user12240555



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!