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

docker compose启动报错:ImportError: Error loading shared library libstdc++.so.6 #22

Closed
hiBlunt opened this issue Dec 23, 2022 · 4 comments

Comments

@hiBlunt
Copy link

hiBlunt commented Dec 23, 2022

git clone本项目后,使用docker compose up -d启动,发现容器报错。docker logs查看报错信息如下:

[Traceback (most recent call last):
  File "/root/.local/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 13, in <module>
    import gevent
  File "/root/.local/lib/python3.7/site-packages/gevent/__init__.py", line 86, in <module>
    from gevent._hub_local import get_hub
  File "/root/.local/lib/python3.7/site-packages/gevent/_hub_local.py", line 101, in <module>
    import_c_accel(globals(), 'gevent.__hub_local')
  File "/root/.local/lib/python3.7/site-packages/gevent/_util.py", line 148, in import_c_accel
    mod = importlib.import_module(cname)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "src/gevent/_hub_local.py", line 1, in init gevent._gevent_c_hub_local
  File "/root/.local/lib/python3.7/site-packages/greenlet/__init__.py", line 29, in <module>
    from ._greenlet import _C_API # pylint:disable=no-name-in-module
ImportError: Error loading shared library libstdc++.so.6: No such file or directory (needed by /root/.local/lib/python3.7/site-packages/greenlet/_greenlet.cpython-37m-x86_64-linux-gnu.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.local/lib/python3.7/site-packages/gunicorn/util.py", line 99, in load_class
    mod = importlib.import_module('.'.join(components))
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/root/.local/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 15, in <module>
    raise RuntimeError("gevent worker requires gevent 1.4 or higher")
RuntimeError: gevent worker requires gevent 1.4 or higher
]
@staugur
Copy link
Member

staugur commented Dec 25, 2022

请问下你的操作系统版本和Python版本

@hiBlunt
Copy link
Author

hiBlunt commented Dec 25, 2022

操作系统:debian11
python版本:3.9.2
docker版本:20.10.22
docker compose版本:2.14.1
PS:我测试过直接源代码安装没有问题,但使用docker compose无法启动。另外根据我的研究,问题根本原因是Dockerfile使用的alpine镜像默认编译器是musl。如果您方便的话,请重新clone代码,并docker compose up -d启动,测试能否复现问题。

@staugur
Copy link
Member

staugur commented Dec 25, 2022 via email

@staugur
Copy link
Member

staugur commented Dec 26, 2022

复现了,已合并,多谢!

@staugur staugur closed this as completed Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants