gpt4 book ai didi

python - 如何成功地将 python-telegram-bot 安装到 Termux 中?

转载 作者:太空宇宙 更新时间:2023-11-04 05:12:35 25 4
gpt4 key购买 nike

我有一个问题。我制作了一个简单的网络抓取电报机器人,我希望它在我的旧手机上运行。但是,我无法通过 pip 安装 python-telegram-bot。我收到这个奇怪的错误消息。有谁知道我该如何解决这个问题?谢谢

> $ pip install python-telegram-bot Collecting python-telegram-bot  
> Using cached
> https://files.pythonhosted.org/packages/84/6c/47932a4041ee76650ad1f45a80e1422077e1e99c08a4d7a61cfbe5393d41/python_telegram_bot-11.1.0-py2.py3-none-any.whl
> Collecting future>=0.16.0 (from python-telegram-bot) Using cached
> https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz
> Collecting certifi (from python-telegram-bot) Using cached
> https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl
> Collecting cryptography (from python-telegram-bot) Using cached
> https://files.pythonhosted.org/packages/f3/39/d3904df7c56f8654691c4ae1bdb270c1c9220d6da79bd3b1fbad91afd0e1/cryptography-2.4.2.tar.gz
> Installing build dependencies ... error Complete output from command
> /data/data/com.termux/files/usr/bin/python -m pip install
> --ignore-installed --no-user --prefix /data/data/com.termux/files/usr/tmp/pip-build-env-cvyz6a4p
> --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.7,!=1.11.3;
> python_implementation != 'PyPy'": Collecting setuptools>=18.5
> Using cached https://files.pythonhosted.org/packages/e7/16/da8cb8046149d50940c6110310983abb359bbb8cbc3539e6bef95c29428a/setuptools-40.6.2-py2.py3-none-any.whl
> Collecting wheel
> Using cached https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
> Collecting cffi!=1.11.3,>=1.7
> Using cached https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz
> Complete output from command python setup.py egg_info:
>
> No working compiler found, or bogus compiler options passed to
> the compiler from Python's standard "distutils" module. See
> the error messages above. Likely, the problem is not related
> to CFFI but generic to the setup.py of any Python package that
> tries to compile C code. (Hints: on OS/X 10.8, for errors about
> -mno-fused-madd see http://stackoverflow.com/questions/22313407/
> Otherwise, see https://wiki.python.org/moin/CompLangPython or
> the IRC channel #python on irc.freenode.net.)
>
> ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in
> /data/data/com.termux/files/usr/tmp/pip-install-kqmk4olx/cffi/
>
> ---------------------------------------- Command
> "/data/data/com.termux/files/usr/bin/python -m pip install
> --ignore-installed --no-user --prefix /data/data/com.termux/files/usr/tmp/pip-build-env-cvyz6a4p
> --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.7,!=1.11.3;
> python_implementation != 'PyPy'"" failed with error code 1 in None $

最佳答案

您必须拥有 Termux 的开发工具链(编译器等)。默认情况下您可以 install clang :

 pkg install clang python-dev

你也可以尝试gcc,参见

https://android.stackexchange.com/a/186223

https://wiki.termux.com/wiki/Package_Management#Community_repositories

关于python - 如何成功地将 python-telegram-bot 安装到 Termux 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53486027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com