日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

Python的pycurl库升级升级失败的解决方法

發(fā)布時(shí)間:2025/5/22 python 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Python的pycurl库升级升级失败的解决方法 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

打算升級(jí)pycurl庫,輸入:pip install --upgrade pycurl,提示如下:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting pycurl
? Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ac/b3/0f3979633b7890bab6098d84c84467030b807a1e2b31f5d30103af5a71ca/pycurl-7.43.0.3.tar.gz (215kB)
???? |████████████████████████████████| 215kB 1.4MB/s
Building wheels for collected packages: pycurl
? Building wheel for pycurl (setup.py) ... error
? ERROR: Command errored out with exit status 1:
?? command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-d658jooi/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-d658jooi/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-1olx_50x --python-tag cp37
?????? cwd: /tmp/pip-install-d658jooi/pycurl/
? Complete output (22 lines):
? Using curl-config (libcurl 7.65.3)
? /tmp/pip-install-d658jooi/pycurl/setup.py:376: DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5
??? dist_name, dist_version, _ = platform.dist()
? Warning: libcurl is configured to use SSL, but we have not been able to determine which SSL backend it is using. If your Curl is built against OpenSSL, LibreSSL, BoringSSL, GnuTLS, NSS or mbedTLS please specify the SSL backend manually. For other SSL backends please ignore this message.Not using an SSL library
? running bdist_wheel
? running build
? running build_py
? creating build
? creating build/lib.linux-x86_64-3.7
? creating build/lib.linux-x86_64-3.7/curl
? copying python/curl/__init__.py -> build/lib.linux-x86_64-3.7/curl
? running build_ext
? building 'pycurl' extension
? creating build/temp.linux-x86_64-3.7
? creating build/temp.linux-x86_64-3.7/src
? gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYCURL_VERSION="7.43.0.3" -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/docstrings.c -o build/temp.linux-x86_64-3.7/src/docstrings.o
? In file included from src/docstrings.c:4:
? src/pycurl.h:4:10: fatal error: Python.h: No such file or directory
????? 4 | #include <Python.h>
??????? |????????? ^~~~~~~~~~
? compilation terminated.
? error: command 'gcc' failed with exit status 1
? ----------------------------------------
? ERROR: Failed building wheel for pycurl
? Running setup.py clean for pycurl
Failed to build pycurl
Installing collected packages: pycurl
? Found existing installation: pycurl 7.43.0.2
ERROR: Cannot uninstall 'pycurl'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

由錯(cuò)誤提示,很明顯,沒有#include <Python.h>頭文件。。

安裝一下python3-devel把。

輸入:dnf install python3-devel,提示如下:

Last metadata expiration check: 0:56:56 ago on Sat 27 Jul 2019 06:12:55 PM CST.
Dependencies resolved.
=======================================================================================================================================
?Package?????????????????????????????????? Architecture????????????? Version????????????????????????? Repository????????????????? Size
=======================================================================================================================================
Installing:
?python3-devel???????????????????????????? x86_64??????????????????? 3.7.3-3.fc30???????????????????? updates??????????????????? 211 k
Installing dependencies:
?python3-rpm-generators??????????????????? noarch??????????????????? 8-1.fc30???????????????????????? updates???????????????????? 23 k
?python-rpm-macros???????????????????????? noarch??????????????????? 3-42.fc30??????????????????????? fedora????????????????????? 11 k
?python-srpm-macros??????????????????????? noarch??????????????????? 3-42.fc30??????????????????????? fedora????????????????????? 11 k
?python3-rpm-macros??????????????????????? noarch??????????????????? 3-42.fc30??????????????????????? fedora????????????????????? 10 k

Transaction Summary
=======================================================================================================================================
Install? 5 Packages

Total download size: 267 k
Installed size: 816 k
Is this ok [y/N]: y
Downloading Packages:
(1/5): python3-rpm-generators-8-1.fc30.noarch.rpm????????????????????????????????????????????????????? 8.3 kB/s |? 23 kB???? 00:02
(2/5): python-rpm-macros-3-42.fc30.noarch.rpm????????????????????????????????????????????????????????? 4.1 kB/s |? 11 kB???? 00:02
(3/5): python-srpm-macros-3-42.fc30.noarch.rpm????????????????????????????????????????????????????????? 61 kB/s |? 11 kB???? 00:00
(4/5): python3-rpm-macros-3-42.fc30.noarch.rpm????????????????????????????????????????????????????????? 51 kB/s |? 10 kB???? 00:00
(5/5): python3-devel-3.7.3-3.fc30.x86_64.rpm??????????????????????????????????????????????????????????? 68 kB/s | 211 kB???? 00:03
---------------------------------------------------------------------------------------------------------------------------------------
Total?????????????????????????????????????????????????????????????????????????????????????????????????? 31 kB/s | 267 kB???? 00:08
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
? Preparing??????? :?????????????????????????????????????????????????????????????????????????????????????????????????????????????? 1/1
? Installing?????? : python-srpm-macros-3-42.fc30.noarch?????????????????????????????????????????????????????????????????????????? 1/5
? Installing?????? : python-rpm-macros-3-42.fc30.noarch??????????????????????????????????????????????????????????????????????????? 2/5
? Installing?????? : python3-rpm-macros-3-42.fc30.noarch?????????????????????????????????????????????????????????????????????????? 3/5
? Installing?????? : python3-rpm-generators-8-1.fc30.noarch??????????????????????????????????????????????????????????????????????? 4/5
? Installing?????? : python3-devel-3.7.3-3.fc30.x86_64???????????????????????????????????????????????????????????????????????????? 5/5
? Running scriptlet: python3-devel-3.7.3-3.fc30.x86_64???????????????????????????????????????????????????????????????????????????? 5/5
? Verifying??????? : python3-devel-3.7.3-3.fc30.x86_64???????????????????????????????????????????????????????????????????????????? 1/5
? Verifying??????? : python3-rpm-generators-8-1.fc30.noarch??????????????????????????????????????????????????????????????????????? 2/5
? Verifying??????? : python-rpm-macros-3-42.fc30.noarch??????????????????????????????????????????????????????????????????????????? 3/5
? Verifying??????? : python-srpm-macros-3-42.fc30.noarch?????????????????????????????????????????????????????????????????????????? 4/5
? Verifying??????? : python3-rpm-macros-3-42.fc30.noarch?????????????????????????????????????????????????????????????????????????? 5/5

Installed:
? python3-devel-3.7.3-3.fc30.x86_64?????????? python3-rpm-generators-8-1.fc30.noarch???????? python-rpm-macros-3-42.fc30.noarch
? python-srpm-macros-3-42.fc30.noarch???????? python3-rpm-macros-3-42.fc30.noarch

Complete!

安裝很順利,成功~

接著輸入:pip install --upgrade pycurl,升級(jí)pycurl,提示如下錯(cuò)誤:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting pycurl
? Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ac/b3/0f3979633b7890bab6098d84c84467030b807a1e2b31f5d30103af5a71ca/pycurl-7.43.0.3.tar.gz (215kB)
???? |████████████████████████████████| 215kB 976kB/s
Building wheels for collected packages: pycurl
? Building wheel for pycurl (setup.py) ... done
? Created wheel for pycurl: filename=pycurl-7.43.0.3-cp37-cp37m-linux_x86_64.whl size=295012 sha256=1910917c1325d6c4abf6e36f2bfa6f64e1869df0c13fc96c33e7d7ae4ceb13ac
? Stored in directory: /root/.cache/pip/wheels/79/4f/eb/a62d903e72f06bdccb8c945a31a12f3e481e84ea0b4b198104
Successfully built pycurl
Installing collected packages: pycurl
? Found existing installation: pycurl 7.43.0.2
ERROR: Cannot uninstall 'pycurl'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

OK,那就加上--ignore-installed選項(xiàng)吧。輸入:pip install --upgrade --ignore-installed pycurl

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting pycurl
Installing collected packages: pycurl
Successfully installed pycurl-7.43.0.3

?至此,升級(jí)完全成功,大功告成~~~~

總結(jié)

以上是生活随笔為你收集整理的Python的pycurl库升级升级失败的解决方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。