Python Pip 安装在 Windows 7 Cygwin 安装上不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21057931/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 21:56:45  来源:igfitidea点击:

Pip install not functioning on windows 7 Cygwin install

pythoncygwininstallpip

提问by rrphenix

I'm having a terrible time of getting pip up and running on Cygwin which I just recently installed on my Windows 7 Computer. I am writing in the hope that anyone out there can tell me what I am doing incorrectly in terms of getting these packages installed correctly.

在我最近安装在 Windows 7 计算机上的 Cygwin 上启动和运行 pip 时,我度过了一段糟糕的时光。我写这篇文章是希望任何人都可以告诉我在正确安装这些软件包方面我做错了什么。

To start, I followed the instructions on this site:

首先,我按照本网站上的说明进行操作:

http://www.pip-installer.org/en/latest/installing.html

http://www.pip-installer.org/en/latest/installing.html

with setuptools installed prior to pip installation. I followed the steps, ran this command:

在 pip 安装之前安装 setuptools。我按照步骤,运行了这个命令:

Ryan@Albert ~
$ python get-pip.py

got this output:

得到这个输出:

Downloading/unpacking pip
Downloading pip-1.5.tar.gz (898kB): 898kB downloaded
  Running setup.py egg_info for package pip

    warning: no files found matching 'pip/cacert.pem'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.rst' found under direct
    no previously-included directories found matching 'docs/_build/_sources'
Installing collected packages: pip
  Running setup.py install for pip

    warning: no files found matching 'pip/cacert.pem'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.rst' found under direct
    no previously-included directories found matching 'docs/_build/_sources'
    Installing pip script to /usr/bin
    Installing pip2.7 script to /usr/bin
    Installing pip2 script to /usr/bin
Successfully installed pip
Cleaning up...

and lo and behold, ran pip with this command:

瞧,用这个命令运行 pip:

Ryan@Albert ~
$ pip install --upgrade setuptools

which led to absolutely no output. A blank line appeared underneath for 3-4 seconds and then the input prompt came up again without pip actually doing anything. I did a bunch more testing to confirm that there was something called pip on my machine but anytime it ran, it essentially did nothing. It did not download or install any programs.

这导致绝对没有输出。一个空行出现在下面 3-4 秒,然后输入提示再次出现,而 pip 实际上没有做任何事情。我做了更多的测试,以确认我的机器上有一个叫做 pip 的东西,但是无论何时它运行,它基本上什么也没做。它没有下载或安装任何程序。

I went about trying to install pip another way after uninstalling the first version. This time I tried:

卸载第一个版本后,我开始尝试以另一种方式安装 pip。这次我尝试了:

$ easy_install pip

And got the following output:

并得到以下输出:

Searching for pip
Best match: pip 1.5
Adding pip 1.5 to easy-install.pth file
Installing pip script to /usr/bin
Installing pip2.7 script to /usr/bin
Installing pip2 script to /usr/bin

Using /usr/lib/python2.7/site-packages
Processing dependencies for pip
Finished processing dependencies for pip

Again, tried using pip to install virtualenv using this command:

再次尝试使用 pip 使用以下命令安装 virtualenv:

$ pip install virtualenv

and it paused for 3-4 seconds, then made the command prompt available again. Exactly like the previous time. When I checked to see whether virtualenv was installed, it was not.

它暂停了 3-4 秒,然后再次使命令提示符可用。和上次一模一样。当我检查是否安装了 virtualenv 时,它没有。

Essentially I have tried and tried to get pip up and running on my windows 7 Cygwin install but to no avail. I am aware of the fact that I can use other packages to install plugins and so forth but I would really appreciate it if someone had any knowledge on why this was happening so it doesn't plague me when I try to install stuff further on down the line.

基本上,我已经尝试并尝试在我的 Windows 7 Cygwin 安装上启动并运行 pip,但无济于事。我知道我可以使用其他软件包来安装插件等等,但如果有人知道为什么会发生这种情况,我将不胜感激,这样当我尝试进一步安装时它不会困扰我线。

Any help would be greatly appreciated!

任何帮助将不胜感激!

采纳答案by Tripp Lilley

There's a bug(?) in 64-bit Cygwin which causes ctypes.utilto segfault when trying to find libuuid(/usr/bin/cyguuid-1.dll). The fix is to install libuuid-develfrom Cygwin setup. I found this from an issue filed against requests.py, but it's noted (and worked around in different ways) in a few other places, too.

64 位 Cygwin 中有一个错误 (?),它会导致ctypes.util在尝试查找libuuid( /usr/bin/cyguuid-1.dll) 时出现段错误。修复方法是从 Cygwin 安装程序安装libuuid-devel。我从针对 requests.py 提交的问题中发现了这一点,但在其他一些地方也注意到(并以不同的方式解决)。

回答by Ivan Ponomarev

Came across the same problem. Installation of binutilscygwin package solved it for me.

遇到了同样的问题。binutilscygwin 包的安装为我解决了这个问题。

回答by Denis Itskovich

There is a work around for this problem: you can pipe the output to another process or to redirect it to file.

有一个解决这个问题的方法:您可以将输出通过管道传输到另一个进程或将其重定向到文件。

For example:

例如:

pip | more

Usage:
  pip <command> [options]

Commands:
  install                     Install packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  help                        Show help for commands.

This will allow seeing stdout, but not stderr. In order to see stderr it also should be redirected:

这将允许看到标准输出,但不能看到标准错误。为了查看 stderr,它也应该被重定向:

pip 2>&1 | more