Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gagal untuk pasang/upgrade mysqlclient 2.1.1 #9

Closed
alserembani94 opened this issue Aug 14, 2022 · 2 comments
Closed

Gagal untuk pasang/upgrade mysqlclient 2.1.1 #9

alserembani94 opened this issue Aug 14, 2022 · 2 comments
Labels
🐞 Pepijat Ada sesuatu yang tidak berfungsi dengan baik

Comments

@alserembani94
Copy link

Saya cuba untuk upgrade pakej menggunakan poetry, tetapi gagal.

Berikut adalah maklumat yang berkaitan:

Info mesin (lokal):

OS - OSX Monterey 12.5
Versi Python - 3.9.4
Versi Poetry - 1.1.14

Langkah penghasilan semula ralat:

  1. poetry install
  2. Semua pakej berjaya diupdate, kecuali mysqlclient

Output:

  • Installing mysqlclient (2.1.1): Failed

  EnvCommandError

  Command ['/Users/alserembani/Library/Caches/pypoetry/virtualenvs/samudra-w3fVXaJ--py3.9/bin/pip', 'install', '--no-deps', 'file:///Users/alserembani/Library/Caches/pypoetry/artifacts/2d/90/d6/339cd2c929c6d8a54167285d71ca5d4c6996063ebeba2e43a6d5e3f698/mysqlclient-2.1.1.tar.gz'] errored with the following return code 1, and output: 
  Processing /Users/alserembani/Library/Caches/pypoetry/artifacts/2d/90/d6/339cd2c929c6d8a54167285d71ca5d4c6996063ebeba2e43a6d5e3f698/mysqlclient-2.1.1.tar.gz
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    error: subprocess-exited-with-error
    
    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [16 lines of output]
        /bin/sh: mysql_config: command not found
        /bin/sh: mariadb_config: command not found
        /bin/sh: mysql_config: command not found
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 34, in <module>
          File "/private/var/folders/93/vjskgv4j0nx3sqqwnb4wpwmw0000gn/T/pip-req-build-hkh5lbs5/setup.py", line 15, in <module>
            metadata, options = get_config()
          File "/private/var/folders/93/vjskgv4j0nx3sqqwnb4wpwmw0000gn/T/pip-req-build-hkh5lbs5/setup_posix.py", line 70, in get_config
            libs = mysql_config("libs")
          File "/private/var/folders/93/vjskgv4j0nx3sqqwnb4wpwmw0000gn/T/pip-req-build-hkh5lbs5/setup_posix.py", line 31, in mysql_config
            raise OSError("{} not found".format(_mysql_config_path))
        OSError: mysql_config not found
        mysql_config --version
        mariadb_config --version
        mysql_config --libs
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed
  
  × Encountered error while generating package metadata.
  ╰─> See above for output.
  
  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  WARNING: You are using pip version 22.0.3; however, version 22.2.2 is available.
  You should consider upgrading via the '/Users/alserembani/Library/Caches/pypoetry/virtualenvs/samudra-w3fVXaJ--py3.9/bin/python -m pip install --upgrade pip' command.
  

  at ~/.poetry/lib/poetry/utils/env.py:1195 in _run
      1191│                 output = subprocess.check_output(
      1192│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1193│                 )
      1194│         except CalledProcessError as e:
    → 1195│             raise EnvCommandError(e, input=input_)
      1196│ 
      1197│         return decode(output)
      1198│ 
      1199│     def execute(self, bin, *args, **kwargs):
@Thaza-Kun Thaza-Kun added the 🐞 Pepijat Ada sesuatu yang tidak berfungsi dengan baik label Aug 14, 2022
@Thaza-Kun
Copy link
Collaborator

Nampaknya mysqlclient memang bermasalah dalam peranti berasaskan M1. Cuba lihat https://stackoverflow.com/questions/67876857/mysqlclient-wont-install-via-pip-on-macbook-pro-m1-with-latest-version-of-big-s dan/atau PyMySQL/mysqlclient#497

@alserembani94
Copy link
Author

Okay, dah jumpa penyelesaian untuk MacOS.

Hanya perlu install mysql di lokal.

brew install mysql

Untuk maklumat lanjut, boleh rujuk https://stackoverflow.com/questions/66669728/trouble-installing-mysql-client-on-mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Pepijat Ada sesuatu yang tidak berfungsi dengan baik
Projects
None yet
Development

No branches or pull requests

2 participants