Skip to content

部署报错 #376

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

Open
AiTian1211 opened this issue Apr 22, 2024 · 3 comments
Open

部署报错 #376

AiTian1211 opened this issue Apr 22, 2024 · 3 comments

Comments

@AiTian1211
Copy link

Collecting anyjson
Using cached https://mirrors.aliyun.com/pypi/packages/c3/4d/d4089e1a3dd25b46bebdb55a992b0797cff657b4477bc32ce28038fdecbc/anyjson-0.3.3.tar.gz (8.3 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in anyjson setup command: use_2to3 is invalid.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

环境
python==3.10.13
setuptools==57.5.0

@tkyztshouhou
Copy link

anyjson==0.3.3
mysqlclient-1.3.13.tar.gz
这两个都安装报错了
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "/home/leo/桌面/mnt/OpsManage/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/home/leo/桌面/mnt/OpsManage/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/leo/桌面/mnt/OpsManage/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-o7uyovdx/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-o7uyovdx/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-o7uyovdx/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-o7uyovdx/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "", line 18, in
File "/tmp/pip-install-wyvydewr/mysqlclient_059fcd10bd7e4cfb8f2e266372371286/setup_posix.py", line 53, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-install-wyvydewr/mysqlclient_059fcd10bd7e4cfb8f2e266372371286/setup_posix.py", line 28, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
python3.8.6
setuptools 49

@welliamcao
Copy link
Owner

没遇到过建议按照文档里面的要求使用python版本

@tkyztshouhou
Copy link

解决了,是mysqlclient的安装问题,windows可以直接安装,macOS和linux安装前需要一些依赖。

macOS (Homebrew)
Install MySQL and mysqlclient:

$ # Assume you are activating Python 3 venv
$ brew install mysql pkg-config
$ pip install mysqlclient
If you don't want to install MySQL server, you can use mysql-client instead:

$ # Assume you are activating Python 3 venv
$ brew install mysql-client pkg-config
$ export PKG_CONFIG_PATH="$(brew --prefix)/opt/mysql-client/lib/pkgconfig"
$ pip install mysqlclient
Linux
Note that this is a basic step. I can not support complete step for build for all environment. If you can see some error, you should fix it by yourself, or ask for support in some user forum. Don't file a issue on the issue tracker.

You may need to install the Python 3 and MySQL development headers and libraries like so:

$ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential pkg-config # Debian / Ubuntu
% sudo yum install python3-devel mysql-devel pkgconfig # Red Hat / CentOS
Then you can install mysqlclient via pip now:

$ pip install mysqlclient
Customize build (POSIX)
mysqlclient uses pkg-config --cflags --ldflags mysqlclient by default for finding compiler/linker flags.

You can use MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS environment variables to customize compiler/linker options.

$ export MYSQLCLIENT_CFLAGS=pkg-config mysqlclient --cflags
$ export MYSQLCLIENT_LDFLAGS=pkg-config mysqlclient --libs
$ pip install mysqlclient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants