在 MSYS2 里安装的 python2-pip 如何使用?

504 views
Skip to first unread message

Xilin Sun

unread,
Oct 4, 2014, 9:05:34 AM10/4/14
to 科大LUG
不知道算不算 OT. 这是一个 Windows 问题,但是我能想到的比较好的求助方法是在 LUG 列表问。

我在64位 Windows 7 下安装了 MSYS2, 然后试图安装 python2-pip. 在安装之前已经执行过 pacman -Sy,
并且 python2 是已经安装上了。在安装 python2-pip 之后我发现并没有 pip
这个命令,我不知道是安装的时候哪里出问题了还是我的 PATH 有问题。请问有人知道如何解决吗?网上给的安装方法是安装
mingw-w64-i686-python2-pip, 我不知道这个和 x86_64 版本有什么区别。这个包不是应该不分架构吗?

安装和执行的记录如下:

$ pacman -S mingw-w64-x86_64-python2-pip
warning: mingw-w64-x86_64-python2-pip-1.5.6-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-x86_64-python2-pip-1.5.6-1

Total Installed Size: 7.48 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring [######################] 100%
(1/1) checking package integrity [######################] 100%
(1/1) loading package files [######################] 100%
(1/1) checking for file conflicts [######################] 100%
(1/1) checking available disk space [######################] 100%
(1/1) reinstalling mingw-w64-x86_64-python2-pip [######################] 100%

sun@sun-win7 ~
$ pip
bash: pip: command not found

sun@sun-win7 ~
$ which pip
which: no pip in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Program
Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files
(x86)/Minimal ADB and
Fastboot:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program
Files (x86)/Microsoft SQL Server/100/Tools/Binn:/c/Program
Files/Microsoft SQL Server/100/Tools/Binn:/c/Program Files/Microsoft
SQL Server/100/DTS/Binn:/c/Program
Files/OpenVPN/bin:/usr/bin/core_perl)

Ding ZhiGang

unread,
Oct 4, 2014, 9:22:27 AM10/4/14
to ustc...@googlegroups.com
是不是这个原因:
http://stackoverflow.com/questions/8548030/syntax-error-on-install-when-doing-pip-install-for-python

---------
Ding ZhiGang
> --
> -- 来自USTC LUG
> 请使用gmail订阅,不要灌水。
> 更多信息more info:http://groups.google.com/group/ustc_lug?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "USTC_LUG" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ustc_lug+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ding ZhiGang

unread,
Oct 4, 2014, 9:29:00 AM10/4/14
to ustc...@googlegroups.com
看你贴出来的东西,貌似你也没在path中添加,到Python\Scripts相应目录下也不能pip吗?

---------
Ding ZhiGang

> 在 2014年10月4日,21:05,Xilin Sun <s.sn.g...@gmail.com> 写道:
>

Guo, Jiahua

unread,
Oct 4, 2014, 9:33:26 AM10/4/14
to ustc...@googlegroups.com

我记得 Archlinux 下,
pacman -Ql python2-pip
能列出这个软件包所包含的文件。

Xilin Sun

unread,
Oct 4, 2014, 10:46:14 AM10/4/14
to 科大LUG
On 4 October 2014 21:33, Guo, Jiahua <gjh...@gmail.com> wrote:
> 我记得 Archlinux 下,
> pacman -Ql python2-pip
> 能列出这个软件包所包含的文件。


谢谢大家,我发现 pip 位置在 D:\msys64\mingw64\bin, 但是这个目录竟然不在 $PATH 里。我自己加进去就能用了。
郭家华说的这个方法确实是能找到文件的。

--
Xilin SUN
Department of Mechanical Engineering
The Hong Kong Polytechnic University
Tel: +852 9140 6662
About me: http://about.me/sxl
Reply all
Reply to author
Forward
0 new messages