GVKun编程网logo

无法安装Python库(python无法安装库怎么办)

14

在本文中,您将会了解到关于无法安装Python库的新资讯,同时我们还将为您解释python无法安装库怎么办的相关在本文中,我们将带你探索无法安装Python库的奥秘,分析python无法安装库怎么办的

在本文中,您将会了解到关于无法安装Python库的新资讯,同时我们还将为您解释python无法安装库怎么办的相关在本文中,我们将带你探索无法安装Python库的奥秘,分析python无法安装库怎么办的特点,并给出一些关于centOS5安装python库的问题!、linux – 无法安装python-igraph、pip 只能安装python库吗、Python 无法安装py2app的实用技巧。

本文目录一览:

无法安装Python库(python无法安装库怎么办)

无法安装Python库(python无法安装库怎么办)

我无法安装任何Python库。我正在使用pip 9.0.1python 2.7。我收到以下错误:

EN-NishantS:~ 8417$ pip install presto-python-clientCollecting presto-python-client  Could not find a version that satisfies the requirement presto-python-client (from versions: )No matching distribution found for presto-python-client

pip install -vvv我一起跑步时,我得到以下信息:

Collecting presto-python-client  1 location(s) to search for versions of presto-python-client:  * https://pypi.python.org/simple/presto-python-client/  Getting page https://pypi.python.org/simple/presto-python-client/  Looking up "https://pypi.python.org/simple/presto-python-client/" in the cache  No cache entry available  Starting new HTTPS connection (1): pypi.python.org  "GET /simple/presto-python-client/ HTTP/1.1" 403 170  Status code 403 not in [200, 203, 300, 301]  Could not fetch URL https://pypi.python.org/simple/presto-python-client/: 403 Client Error: TLSv1.2+ is required for url: https://pypi.python.org/simple/presto-python-client/ - skipping  Could not find a version that satisfies the requirement presto-python-client (from versions: )Cleaning up...No matching distribution found for presto-python-clientException information:Traceback (most recent call last):  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main    status = self.run(options, args)  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 324, in run    requirement_set.prepare_files(finder)  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 380, in prepare_files    ignore_dependencies=self.ignore_dependencies))  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 554, in _prepare_file    require_hashes  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 278, in populate_link    self.link = finder.find_requirement(self, upgrade)  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/index.py", line 514, in find_requirement    ''No matching distribution found for %s'' % reqDistributionNotFound: No matching distribution found for presto-python-clientLooking up "https://pypi.python.org/pypi/pip/json" in the cacheNo cache entry availableStarting new HTTPS connection (1): pypi.python.org"GET /pypi/pip/json HTTP/1.1" 403 170Status code 403 not in [200, 203, 300, 301]There was an error checking the latest version of pipTraceback (most recent call last):  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/outdated.py", line 128, in pip_version_check    resp.raise_for_status()  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/models.py", line 862, in raise_for_status    raise HTTPError(http_error_msg, response=self)HTTPError: 403 Client Error: TLSv1.2+ is required for url: https://pypi.python.org/pypi/pip/json

答案1

小编典典

在Mac上,您可以 sudo curl https://bootstrap.pypa.io/get-pip.py | python

centOS5安装python库的问题!

centOS5安装python库的问题!

centOS5的yum用的python2.4
而生产环境需要python2.7, 于是再装一个python2.7, 程序需要用到libxml2, 这个库需要使用yum来安装, 但是安装之后py文件跑到python2.4的site-packages里去了, python2.7里显然调用不了, 也试过下载源码进行编译安装, 但是也不行, 想知道这种情况应该怎么解决, 谢谢!

linux – 无法安装python-igraph

linux – 无法安装python-igraph

我正在尝试安装 python-igraph.我运行sudo pip后运行python-igraph我得到了以下日志:
Downloading/unpacking python-igraph
  Downloading python-igraph-0.7.1-1.tar.gz (375kB): 375kB downloaded
  Running setup.py egg_info for package python-igraph

Installing collected packages: python-igraph
  Running setup.py install for python-igraph
    Cannot find the C core of igraph on this system using pkg-config.
    We will Now try to download and compile the C core from scratch.
    Version number of the C core: 0.7.1-1

    Version 0.7.1-1 of the C core of igraph is not found among the nightly builds.
    Use the --c-core-version switch to try a different version.

    Could not download and compile the C core of igraph.

    WARNING: we were not able to detect where igraph is installed on
    your machine (if it is installed at all). We will use the fallback
    library and include pathss hardcoded in setup.py and hope that the
    C core of igraph is installed there.

    If the compilation fails and you are sure that igraph is installed
    on your machine,adjust the following two variables in setup.py
    accordingly and try again:

    - LIBIGRAPH_FALLBACK_INCLUDE_Dirs
    - LIBIGRAPH_FALLBACK_LIBRARY_Dirs

Build type: dynamic extension                                    
    Include path: /usr/include/igraph /usr/local/include/igraph
    Library path:
    Linked dynamic libraries: igraph
    Linked static libraries:
    Extra compiler options:
    Extra linker options:
    building 'igraph._igraph' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/igraph -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/igraphmodule.c -o build/temp.linux-x86_64-2.7/src/igraphmodule.o
    src/igraphmodule.c:25:20: Fatal error: igraph.h: No such file or directory
     #include <igraph.h>
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' Failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n','\n'),__file__,'exec'))" install --record /tmp/pip-cTa4Ba-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/igraph

copying igraph/formula.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/__init__.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/configuration.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/summary.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/layout.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/cut.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/datatypes.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/utils.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/clustering.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/statistics.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/matching.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/compat.py -> build/lib.linux-x86_64-2.7/igraph

creating build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/operators.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/isomorphism.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/__init__.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/colortests.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/conversion.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/homepage.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/attributes.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/vertexseq.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/structural.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/separators.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/atlas.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/layouts.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/rng.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/games.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/utils.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/iterators.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/edgeseq.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/indexing.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/spectral.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/cliques.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/flow.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/basic.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/generators.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/matching.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/foreign.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/bipartite.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/decomposition.py -> build/lib.linux-x86_64-2.7/igraph/test

creating build/lib.linux-x86_64-2.7/igraph/app

copying igraph/app/__init__.py -> build/lib.linux-x86_64-2.7/igraph/app

copying igraph/app/shell.py -> build/lib.linux-x86_64-2.7/igraph/app

creating build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/__init__.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/edge.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/shapes.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/coord.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/Metamagic.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/utils.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/text.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/graph.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/colors.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/vertex.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/baseclasses.py -> build/lib.linux-x86_64-2.7/igraph/drawing

creating build/lib.linux-x86_64-2.7/igraph/remote

copying igraph/remote/__init__.py -> build/lib.linux-x86_64-2.7/igraph/remote

copying igraph/remote/nexus.py -> build/lib.linux-x86_64-2.7/igraph/remote

copying igraph/remote/gephi.py -> build/lib.linux-x86_64-2.7/igraph/remote

creating build/lib.linux-x86_64-2.7/igraph/vendor

copying igraph/vendor/__init__.py -> build/lib.linux-x86_64-2.7/igraph/vendor

copying igraph/vendor/texttable.py -> build/lib.linux-x86_64-2.7/igraph/vendor

running build_ext

Cannot find the C core of igraph on this system using pkg-config.

We will Now try to download and compile the C core from scratch.

Version number of the C core: 0.7.1-1



Version 0.7.1-1 of the C core of igraph is not found among the nightly builds.

Use the --c-core-version switch to try a different version.



Could not download and compile the C core of igraph.



WARNING: we were not able to detect where igraph is installed on

your machine (if it is installed at all). We will use the fallback

library and include pathss hardcoded in setup.py and hope that the

C core of igraph is installed there.



If the compilation fails and you are sure that igraph is installed

on your machine,adjust the following two variables in setup.py

accordingly and try again:



- LIBIGRAPH_FALLBACK_INCLUDE_Dirs

- LIBIGRAPH_FALLBACK_LIBRARY_Dirs



Build type: dynamic extension                                    

Include path: /usr/include/igraph /usr/local/include/igraph

Library path:

Linked dynamic libraries: igraph

Linked static libraries:

Extra compiler options:

Extra linker options:

building 'igraph._igraph' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/src

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/igraph -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/igraphmodule.c -o build/temp.linux-x86_64-2.7/src/igraphmodule.o

src/igraphmodule.c:25:20: Fatal error: igraph.h: No such file or directory

 #include <igraph.h>

                    ^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' Failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n','exec'))" install --record /tmp/pip-cTa4Ba-record/install-record.txt --single-version-externally-managed Failed with error code 1 in /tmp/pip_build_root/python-igraph
Storing complete log in /home/sergey/.pip/pip.log

如果我使用sudo python setup.py install,我也有类似的情况.

显然问题在于C核心.

如何安装正确的版本以便我可以安装igraph?

我使用Linux Mint 16 64位,python 2.7.

解决方法

在编译python-igraph之前,你需要igraph库.

尝试sudo apt-get install -y libigraph0-dev并再次尝试安装python-igraph.

pip 只能安装python库吗

pip 只能安装python库吗

pip 是 python 包管理工具,该工具提供了对python 包的查找、下载、安装、卸载的功能。目前如果你在 python.org 下载最新版本的安装包,则是已经自带了该工具。

Python 2.7.9 + 或 Python 3.4+ 以上版本都自带 pip 工具。

pip 只能安装python库吗

pip 官网:https://pypi.org/project/pip/

你可以通过以下命令来判断是否已安装:

立即学习“Python免费学习笔记(深入)”;

pip --version
登录后复制

如果你还未安装,则可以使用以下方法来安装:

$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py   # 下载安装脚本
$ sudo python get-pip.py    # 运行安装脚本
登录后复制

注意:用哪个版本的 Python 运行安装脚本,pip 就被关联到哪个版本,如果是 Python3 则执行以下命令:

$ sudo python3 get-pip.py    # 运行安装脚本。
登录后复制

一般情况 pip 对应的是 Python 2.7,pip3 对应的是 Python 3.x。

部分 Linux 发行版可直接用包管理器安装 pip,如 Debian 和 Ubuntu:

sudo apt-get install python-pip
登录后复制

以上就是pip 只能安装python库吗的详细内容,更多请关注php中文网其它相关文章!

Python 无法安装py2app

Python 无法安装py2app

因为需要给mac程序打包应用,需要安装py2app

正常安装pip install py2app,结果报错

image.png

这个程序报错是因为电脑没有被授信

pip install --trusted-host pypi.python.org --trusted-host CHJ-XUYUN  --trusted-host files.pythonhosted.org py2app

image.png

今天关于无法安装Python库python无法安装库怎么办的介绍到此结束,谢谢您的阅读,有关centOS5安装python库的问题!、linux – 无法安装python-igraph、pip 只能安装python库吗、Python 无法安装py2app等更多相关知识的信息可以在本站进行查询。

本文标签: