Thiết lập python py egg_info kiểm tra nhật ký để biết đầu ra lệnh đầy đủ mysqlclient

Một số người đã chú ý đến tôi rằng tập lệnh cài đặt tự động SkyWeather2 của tôi không hoàn thành. Sự cố đã được khắc phục và phiên bản mới của tập lệnh có sẵn tại đây

Tập lệnh mới nhất đã được thử nghiệm với SkyWeather2 Phiên bản 027. 1 và Raspberry PiOS ngày 30 tháng 10 năm 2021

sopwith

$ pip install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-2.0.3.tar.gz (88 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/song/miniconda3/envs/westarbucks/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oc1xpiyw/mysqlclient_5065485605a44b02905d19b84f655f73/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oc1xpiyw/mysqlclient_5065485605a44b02905d19b84f655f73/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-pip-egg-info-xra4p4nm
         cwd: /tmp/pip-install-oc1xpiyw/mysqlclient_5065485605a44b02905d19b84f655f73/
    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
$pip install --upgrade pip
$pip install --upgrade setuptools
$pip install ez_setup
$sudo yum install python3-devel mysql-devel
$sudo yum install -y gcc
$pip install mysqlclient

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 ERROR: Command errored out with exit status 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

python-dev chứa tệp tiêu đề mà hệ thống cần để xây dựng tiện ích mở rộng Python. Nó được sử dụng bởi lxml 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

lxml 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 _______5_______0

Các nguồn lxml ít nhất phải có 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 Django MySQLClient pip 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 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.3 [1,320 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl-dev amd64 1.1.1f-1ubuntu2.3 [1,582 kB]
Get:3 http://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 cần thiết cho hệ thống cần thiết cho hoạt động của mysqlclient

Làm cách nào để kiểm tra nhật ký cho lệnh đầu ra đầy đủ pip?

Bạn có thể thử chạy lệnh pip bằng cách thêm cờ --verbose . Điều này sẽ in ra các bản ghi trong Terminal, sau đó bạn có thể kiểm tra. Các nhật ký này thường giúp bạn chỉ ra nguyên nhân gây ra lỗi. Lưu câu trả lời này.

Mã lỗi 1 trong cài đặt tmp pip là gì?

Mã lỗi 1 được định nghĩa là Thao tác không được phép trong ký hiệu hệ thống lỗi tiêu chuẩn của python . Sự cố này chủ yếu xảy ra khi các công cụ thiết lập của bạn dường như không được cài đặt hoặc cập nhật.