Chạy cài đặt py cài đặt cho lỗi mysqlclient ubuntu

Phiên bản Python == 3. 10. 5

Đây là lỗi tôi nhận được

Đang cài đặt mysqlclient…
Lỗi. Đã xảy ra lỗi khi cài đặt mysqlclient.
Văn bản lỗi. Đang thu thập mysqlclient
Sử dụng mysqlclient-2 đã lưu trong bộ nhớ cache. 1. 1. hắc ín. gz [88 kB]
Đang chuẩn bị siêu dữ liệu [thiết lập. py]. đã bắt đầu
Chuẩn bị siêu dữ liệu [thiết lập. py]. kết thúc với trạng thái ‘lỗi’

lỗi. sub process-exit-with-error

× thiết lập python. py egg_info không chạy thành công.
│ mã thoát. 1
╰─> [16 dòng đầu ra]
/bin/sh. mysql_config. không tìm thấy lệnh
/bin/sh. mariadb_config. lệnh không tìm thấy
/bin/sh. mysql_config. không tìm thấy lệnh
Traceback [lần gọi gần đây nhất].
Tệp “”, dòng 2, trong
Tệp “”, dòng 34, trong
Tệp “/private/var/ . py”, dòng 15, trong
siêu dữ liệu, tùy chọn = get_config[]
Tệp “/private/var/folders/9d/_sspqdqx72j3xbj_00_4tnnc0000gn/T/pip-install . py”, dòng 70, trong get_config
libs = mysql_config[“libs”]
Tệp “/private/var/folders/9d/_sspqdqx72j3xbj_00_4tnnc0000gn/T/pip . py”, dòng 31, trong mysql_config
raise OSError[“{} not found”. định dạng[_mysql_config_path]]
Lỗi OS. không tìm thấy mysql_config
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]

ghi chú. Lỗi này bắt nguồn từ một quy trình con và có thể không phải là sự cố với pip.
lỗi. tạo siêu dữ liệu không thành công

× Đã gặp lỗi khi tạo siêu dữ liệu gói.
╰─> Xem ở trên để biết đầu ra.

ghi chú. Đây là sự cố với gói được đề cập ở trên, không phải pip.
gợi ý. Xem ở trên để biết chi tiết.

Điều này có thể là do lỗi trong mysqlclient. Báo cáo điều này cho người bảo trì của nó.
✘ Cài đặt không thành công

Xin chào, tôi đang gặp sự cố chặn này khi thiết lập Django với cơ sở dữ liệu MySQL. Tôi đang dán ở đây những gì tôi đã thử cho đến nay trên Ubuntu 18. 04 HĐH

$ sudo apt install nginx mysql-server python3-pip python3-dev libmysqlclient-dev 
$ sudo apt install mysql-client
$ sudo mysql_secure_installation
$ sudo mysql [ configured new db requirements ]
$ sudo -H pip3 install --upgrade pip
$ sudo -H pip3 install virtualenv
$ pip install django gunicorn mysqlclient [virtualenv] 

Đây là nơi mysqlclient không được cài đặt. Đây là đoạn lỗi

[vkdev]user@ubuntu-hejjjj:~/testproject$ pip install mysqlclient
Collecting mysqlclient
  Using cached //files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient [setup.py] .. error
  ERROR: Command errored out with exit status 1:
......   
.......
  /usr/bin/ld: cannot find -lssl
  /usr/bin/ld: cannot find -lcrypto
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient .. error
    ERROR: Command errored out with exit status 1:

Vì cài đặt mysqlclient không thành công ở đây, tôi đã tiếp tục thử các bước này nhưng cho đến nay tôi không gặp may

LỖI. Lệnh bị lỗi với trạng thái thoát 1 mysqlclient. Tôi đang cài đặt mysqlclient cho dự án Django mới trong Ubuntu Linux mới cài đặt của mình. Và sau khi thực hiện pip install mysqlclient, tôi gặp lỗi

[vkdev]user@ubuntu-hejjjj:~/testproject$ pip install mysqlclient
Collecting mysqlclient
  Using cached //files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient [setup.py] .. error
  ERROR: Command errored out with exit status 1:
......   
.......
  /usr/bin/ld: cannot find -lssl
  /usr/bin/ld: cannot find -lcrypto
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient .. error
    ERROR: Command errored out with exit status 1:
1

[env] [email protected]:~/Projects/aeck$ pip3 install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-2.0.3.tar.gz [88 kB]
    ERROR: Command errored out with exit status 1:
     command: /home/codie/Projects/aeck/env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4_d_xjb9/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4_d_xjb9/mysqlclient/setup.py'"'"';f=getattr[tokenize, '"'"'open'"'"', open][__file__];code=f.read[].replace['"'"'\r\n'"'"', '"'"'\n'"'"'];f.close[];exec[compile[code, __file__, '"'"'exec'"'"']]' egg_info --egg-base /tmp/pip-install-4_d_xjb9/mysqlclient/pip-egg-info
         cwd: /tmp/pip-install-4_d_xjb9/mysqlclient/
    Complete output [15 lines]:
    /bin/sh: 1: mysql_config: not found
    /bin/sh: 1: mariadb_config: not found
    /bin/sh: 1: mysql_config: not found
    Traceback [most recent call last]:
      File "", line 1, in 
      File "/tmp/pip-install-4_d_xjb9/mysqlclient/setup.py", line 15, in 
        metadata, options = get_config[]
      File "/tmp/pip-install-4_d_xjb9/mysqlclient/setup_posix.py", line 70, in get_config
        libs = mysql_config["libs"]
      File "/tmp/pip-install-4_d_xjb9/mysqlclient/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
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Ngoài ra, giải quyết vấn đề của bạn về lỗi psycopg2 cài đặt ubuntu

Vì vậy, làm thế nào chúng ta có thể khắc phục vấn đề /bin/sh. 1. mysql_config. không tìm thấy hoặc /bin/sh. 1. mariadb_config. không tìm thấy

Tôi đã thực hiện một số nghiên cứu và sau khi tìm kiếm trang web trong 15 phút, tôi đã khắc phục được sự cố này

Sửa lỗi. Lệnh bị lỗi với trạng thái thoát 1 mysqlclient

Để khắc phục sự cố lỗi pip install mysqlclient, bạn chỉ cần sao chép các mã bên dưới và thực thi chúng trong bash-shell của mình

Cài đặt gói python3-dev

[vkdev]user@ubuntu-hejjjj:~/testproject$ pip install mysqlclient
Collecting mysqlclient
  Using cached //files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient [setup.py] .. error
  ERROR: Command errored out with exit status 1:
......   
.......
  /usr/bin/ld: cannot find -lssl
  /usr/bin/ld: cannot find -lcrypto
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient .. error
    ERROR: Command errored out with exit status 1:
2 chứa tệp tiêu đề mà hệ thống cần để xây dựng phần mở rộng Python. Nó được sử dụng bởi 
[vkdev]user@ubuntu-hejjjj:~/testproject$ pip install mysqlclient
Collecting mysqlclient
  Using cached //files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient [setup.py] .. error
  ERROR: Command errored out with exit status 1:
......   
.......
  /usr/bin/ld: cannot find -lssl
  /usr/bin/ld: cannot find -lcrypto
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient .. error
    ERROR: Command errored out with exit status 1:
3 vì nó bao gồm các tiện ích mở rộng Python C để có hiệu suất cao

sudo apt-get install python3-dev

[vkdev]user@ubuntu-hejjjj:~/testproject$ pip install mysqlclient
Collecting mysqlclient
  Using cached //files.pythonhosted.org/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient [setup.py] .. error
  ERROR: Command errored out with exit status 1:
......   
.......
  /usr/bin/ld: cannot find -lssl
  /usr/bin/ld: cannot find -lcrypto
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient .. error
    ERROR: Command errored out with exit status 1:
3 là một tiện ích mở rộng Python C-API được biên dịch khi chúng ta chạy lệnh 
sudo apt-get install python3-dev
0

Các nguồn lxml có ít nhất thứ gì đó giống như 

sudo apt-get install python3-dev
1 trong mã. Trình biên dịch tìm tệp tiêu đề 
sudo apt-get install python3-dev
2 trong quá trình biên dịch, do đó các tệp tiêu đề đó cần phải có trên hệ thống của bạn để có thể tìm thấy chúng

Ngoài ra, giải quyết. Lỗi biên dịch pip Django MySQLClient trên Linux

[env] [email protected]:~/Projects/aeck$ sudo apt-get install libmysqlclient-dev
Reading package lists.. Done
Building dependency tree       
Reading state information.. Done
The following additional packages will be installed:
  libssl-dev libssl1.1
Suggested packages:
  libssl-doc
The following NEW packages will be installed:
  libmysqlclient-dev libssl-dev
The following packages will be upgraded:
  libssl1.1
1 upgraded, 2 newly installed, 0 to remove and 107 not upgraded.
Need to get 4,437 kB of archives.
After this operation, 17.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 //us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.3 [1,320 kB]
Get:2 //us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl-dev amd64 1.1.1f-1ubuntu2.3 [1,582 kB]
Get:3 //us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libmysqlclient-dev amd64 8.0.23-0ubuntu0.20.04.1 [1,536 kB]
Fetched 4,437 kB in 5s [921 kB/s]               
Preconfiguring packages ...
[Reading database .. 132596 files and directories currently installed.]
Preparing to unpack .../libssl1.1_1.1.1f-1ubuntu2.3_amd64.deb ...
Unpacking libssl1.1:amd64 [1.1.1f-1ubuntu2.3] over [1.1.1f-1ubuntu2.1] ...
Selecting previously unselected package libssl-dev:amd64.
Preparing to unpack .../libssl-dev_1.1.1f-1ubuntu2.3_amd64.deb ...
Unpacking libssl-dev:amd64 [1.1.1f-1ubuntu2.3] ...
Selecting previously unselected package libmysqlclient-dev.
Preparing to unpack .../libmysqlclient-dev_8.0.23-0ubuntu0.20.04.1_amd64.deb ...
Unpacking libmysqlclient-dev [8.0.23-0ubuntu0.20.04.1] ...
Setting up libssl1.1:amd64 [1.1.1f-1ubuntu2.3] ...
Setting up libssl-dev:amd64 [1.1.1f-1ubuntu2.3] ...
Setting up libmysqlclient-dev [8.0.23-0ubuntu0.20.04.1] ...
Processing triggers for man-db [2.9.1-1] ...
Processing triggers for libc-bin [2.31-0ubuntu9.2] ...

Cài đặt phụ thuộc cho mysqlclient

Bây giờ, bạn chỉ cần cài đặt phần phụ thuộc cho mysqlclient có tên là

sudo apt-get install python3-dev
3

sudo apt-get install libmysqlclient-dev

sudo apt-get install python3-dev
3 là gói cung cấp tất cả các tài nguyên và phụ thuộc thiết yếu cho hệ thống cần thiết cho hoạt động của mysqlclient

Làm cách nào để cài đặt máy khách MySQL trong Ubuntu?

Ghi chú. Nếu bạn chưa nâng cấp hệ thống của mình từ 18. 04 chưa, hãy xem hướng dẫn cài đặt MySQL trên Ubuntu 18 của chúng tôi. 04. .
Bước 1. Cập nhật/Nâng cấp kho lưu trữ gói. .
Bước 2. Cài đặt MySQL. .
Bước 3. Bảo mật MySQL. .
Bước 4. Kiểm tra xem dịch vụ MySQL có đang chạy không. .
Bước 5. Đăng nhập vào máy chủ MySQL

Làm cách nào để cài đặt ứng dụng khách MySQL cho Django trong Ubuntu?

Trước hết, chúng ta cần cài đặt MySQL bằng lệnh sudo apt-get install -y mysql-server như hình bên dưới. .
Cài đặt máy chủ MySQL. .
Cài đặt bàn làm việc MySQL. .
Đặt mật khẩu người dùng MySQL. .
Yêu cầu cài đặt Python3. 7 phụ thuộc. .
Kiểm tra phiên bản Python và tạo môi trường ảo. .
Kiểm tra phiên bản Django

mysqlclient có hỗ trợ python 3 không?

Dự án này là một nhánh của MySQLdb1. Dự án này bổ sung hỗ trợ Python 3 và sửa nhiều lỗi.

Làm cách nào để cài đặt thư viện máy khách MySQL Linux?

2. 2 Cài đặt MySQL Shell trên Linux .
Cập nhật thông tin gói cho kho lưu trữ MySQL APT. sudo apt-get cập nhật
Cập nhật gói cấu hình kho lưu trữ MySQL APT bằng lệnh sau. sudo apt-get cài đặt mysql-apt-config. .
Cài đặt MySQL Shell bằng lệnh này. sudo apt-get cài đặt mysql-shell

Chủ Đề