Python - Django, Cannot install mysqlclient using pip

133 views Asked by At

I'm new to Django and I'm facing some issues installing mysqlclient for my application running this command

pip install mysqlclient

I'm getting an error ModuleNotFoundError: No module named 'pip._internal.operations.build.wheel_legacy'

Traceback (most recent call last):
  File "C:\Users\Ahmad\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Ahmad\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "E:\Python-projects\web_project\venv\Scripts\pip.exe\__main__.py", line 7, in <module>
  File "e:\python-projects\web_project\venv\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "e:\python-projects\web_project\venv\lib\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
    module = importlib.import_module(module_path)
  File "C:\Users\Ahmad\AppData\Local\Programs\Python\Python38-32\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "e:\python-projects\web_project\venv\lib\site-packages\pip\_internal\commands\install.py", line 37, in <module>
    from pip._internal.wheel_builder import build, should_build_for_install_command
  File "e:\python-projects\web_project\venv\lib\site-packages\pip\_internal\wheel_builder.py", line 11, in <module>
    from pip._internal.operations.build.wheel_legacy import build_wheel_legacy
ModuleNotFoundError: No module named 'pip._internal.operations.build.wheel_legacy'

I have Python 3.8.3 and pip 20.2.3

what is the cause of this error and how can I solve it?

0

There are 0 answers