4

我遇到了一个 github 项目,我正在尝试安装和运行它,但我遇到了一些问题。我也把它作为一个问题提出来。整个 pip 日志在那里可用。

如果我理解正确的话,这个问题似乎围绕着 distutils:

f:\python27\Lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'use_2to3' warnings.warn(msg) error: Unable to find vcvarsall.bat

查找这个我被引导到错误: Unable to find vcvarsall.bat

现在检查我的系统,我安装了 MS Visual C++ 2005,2008,2010。我没有 Visual Studio。我正在使用带有安装了 MINGW32 的 git-bash 的 win 7。在上面的线程 fpessoa 中讨论了setup.py install build --compiler=mingw32. 我决定尝试以下方法:

  1. 我已经安装了 python 2.7。
  2. 将 mingw32 的 bin 目录添加到环境变量:将PATH附加到f:\git\bin;
  3. 创建distutils.cfg位于C:\Python27\Lib\distutils\distutils.cfg

    [build]
    compiler=mingw32
    

不幸的是,我仍然遇到同样的错误。

这和执行是一样的setup.py install build --compiler=mingw32吗?如果不是,我如何让 setup.py 在读取 requirements.txt 时使用 --compiler=mingw32 参数?

我的 f:\git\bin 的内容是:

drwxr-xr-x   19 bsmith     Administ        0 Nov 23 10:33 ..
-rwxr-xr-x    1 bsmith     Administ   215040 Oct 23 03:26 antiword.exe
-rwxr-xr-x    1 bsmith     Administ      540 Jun 27  2012 astextplain
-rwxr-xr-x    1 bsmith     Administ      170 Jun 27  2012 awk
-rwxr-xr-x    1 bsmith     Administ    18432 Oct 23 03:26 basename.exe
-rwxr-xr-x    1 bsmith     Administ   540672 Oct 23 03:26 bash.exe
-rwxr-xr-x    1 bsmith     Administ  1299968 Oct 23 03:26 bison.exe
-rwxr-xr-x    1 bsmith     Administ      188 Jun 27  2012 bunzip2
-rwxr-xr-x    1 bsmith     Administ    75264 Oct 23 03:26 bzip2.exe
-rwxr-xr-x    1 bsmith     Administ     3802 Jun 27  2012 c_rehash
-rwxr-xr-x    1 bsmith     Administ    22528 Oct 23 03:26 cat.exe
-rwxr-xr-x    1 bsmith     Administ    28160 Oct 23 03:26 chmod.exe
-rwxr-xr-x    1 bsmith     Administ      103 Jun 27  2012 clear
-rwxr-xr-x    1 bsmith     Administ    11264 Oct 23 03:26 cmp.exe
-rwxr-xr-x    1 bsmith     Administ    52224 Oct 23 03:26 connect.exe
-rwxr-xr-x    1 bsmith     Administ    74240 Oct 23 03:26 cp.exe
-rw-r--r--    1 bsmith     Administ   227107 Jul 10  2012 curl-ca-bundle.
-rwxr-xr-x    1 bsmith     Administ   404992 Oct 23 03:26 curl.exe
-rwxr-xr-x    1 bsmith     Administ    24064 Oct 23 03:26 cut.exe
-rwxr-xr-x    1 bsmith     Administ    47616 Oct 23 03:26 date.exe
-rwxr-xr-x    1 bsmith     Administ    68608 Oct 23 03:26 diff.exe
-rwxr-xr-x    1 bsmith     Administ    17920 Oct 23 03:26 dirname.exe
-rwxr-xr-x    1 bsmith     Administ    11763 Jun 27  2012 docx2txt
-rwxr-xr-x    1 bsmith     Administ    15872 Oct 23 03:26 dos2unix.exe
-rwxr-xr-x    1 bsmith     Administ    65536 Oct 23 03:26 du.exe
-rwxr-xr-x    1 bsmith     Administ      171 Jun 27  2012 echo
-rwxr-xr-x    1 bsmith     Administ      175 Jun 27  2012 egrep
-rwxr-xr-x    1 bsmith     Administ    18944 Oct 23 03:26 env.exe
-rwxr-xr-x    1 bsmith     Administ    49152 Oct 23 03:26 expr.exe
-rwxr-xr-x    1 bsmith     Administ    12288 Oct 23 03:26 false.exe
-rwxr-xr-x    1 bsmith     Administ    52224 Oct 23 03:26 find.exe
-rwxr-xr-x    1 bsmith     Administ  1330176 Oct 23 03:26 flex.exe
-rwxr-xr-x    1 bsmith     Administ   149504 Oct 23 03:26 gawk.exe
-rwxr-xr-x    1 bsmith     Administ     5632 Oct 23 03:26 getcp.exe
-rwxr-xr-x    1 bsmith     Administ  1363968 Oct 23 03:26 git-receive-pac
-rwxr-xr-x    1 bsmith     Administ  1363968 Oct 23 03:26 git-upload-arch
-rwxr-xr-x    1 bsmith     Administ   654848 Oct 23 03:26 git-upload-pack
-rwxr-xr-x    1 bsmith     Administ  1363968 Oct 23 03:26 git.exe
-rwxr-xr-x    1 bsmith     Administ   330727 Oct 22 17:01 gitk
-rwxr-xr-x    1 bsmith     Administ     3374 Feb 28  2009 gpg-zip
-rwxr-xr-x    1 bsmith     Administ   486448 Feb 28  2009 gpg.exe
-rwxr-xr-x    1 bsmith     Administ    64309 Feb 28  2009 gpgsplit.exe
-rwxr-xr-x    1 bsmith     Administ   217749 Feb 28  2009 gpgv.exe
-rwxr-xr-x    1 bsmith     Administ    81408 Oct 23 03:26 grep.exe
-rwxr-xr-x    1 bsmith     Administ    50688 Oct 23 03:26 gunzip.exe
-rwxr-xr-x    1 bsmith     Administ    50688 Oct 23 03:26 gzip.exe
-rwxr-xr-x    1 bsmith     Administ    26624 Oct 23 03:26 head.exe
-rwxr-xr-x    1 bsmith     Administ    21504 Oct 23 03:26 id.exe
-rwxr-xr-x    1 bsmith     Administ    10240 Oct 23 03:26 kill.exe
-rwxr-xr-x    1 bsmith     Administ   112128 Oct 23 03:26 less.exe
-rwxr-xr-x    1 bsmith     Administ   812063 Jun 27  2012 libW11.dll
-rwxr-xr-x    1 bsmith     Administ   200015 Jun 27  2012 libapr-0-0.dll
-rwxr-xr-x    1 bsmith     Administ   146280 Jun 27  2012 libaprutil-0-0.
-rwxr-xr-x    1 bsmith     Administ  1723196 Jun  6  2012 libcrypto.dll
-rwxr-xr-x    1 bsmith     Administ   411907 Jan 12  2012 libcurl-4.dll
-rwxr-xr-x    1 bsmith     Administ   184599 Jun 27  2012 libexpat-0.dll
-rw-r--r--    1 bsmith     Administ     7465 Jan 12  2012 libgsasl-7.def
-rwxr-xr-x    1 bsmith     Administ   443550 Jan 12  2012 libgsasl-7.dll
-rwxr-xr-x    1 bsmith     Administ  1241889 May 31  2012 libiconv-2.dll
-rwxr-xr-x    1 bsmith     Administ   978432 Feb 28  2009 libiconv2.dll
-rwxr-xr-x    1 bsmith     Administ   177216 Jun 27  2012 libneon-25.dll
-rwxr-xr-x    1 bsmith     Administ  4884531 Jan 12  2012 libpoppler-7.dl
-rwxr-xr-x    1 bsmith     Administ   378238 Jun  6  2012 libssl.dll
-rwxr-xr-x    1 bsmith     Administ   255849 Jun 27  2012 libsvn_client-1
-rwxr-xr-x    1 bsmith     Administ    77401 Jun 27  2012 libsvn_delta-1-
-rwxr-xr-x    1 bsmith     Administ    57948 Jun 27  2012 libsvn_diff-1-0
-rwxr-xr-x    1 bsmith     Administ    49557 Jun 27  2012 libsvn_fs-1-0.d
-rwxr-xr-x    1 bsmith     Administ   172387 Jun 27  2012 libsvn_fs_fs-1-
-rwxr-xr-x    1 bsmith     Administ    37342 Jun 27  2012 libsvn_ra-1-0.d
-rwxr-xr-x    1 bsmith     Administ   181083 Jun 27  2012 libsvn_ra_dav-1
-rwxr-xr-x    1 bsmith     Administ    62039 Jun 27  2012 libsvn_ra_local
-rwxr-xr-x    1 bsmith     Administ   123176 Jun 27  2012 libsvn_ra_svn-1
-rwxr-xr-x    1 bsmith     Administ   202003 Jun 27  2012 libsvn_repos-1-
-rwxr-xr-x    1 bsmith     Administ   266235 Jun 27  2012 libsvn_subr-1-0
-rwxr-xr-x    1 bsmith     Administ    73712 Jun 27  2012 libsvn_swig_per

-rwxr-xr-x    1 bsmith     Administ   284454 Jun 27  2012 libsvn_wc-1-0.d
-rwxr-xr-x    1 bsmith     Administ   194947 Jun 27  2012 libz.dll
-rwxr-xr-x    1 bsmith     Administ    72704 Oct 23 03:26 ln.exe
-rwxr-xr-x    1 bsmith     Administ    69632 Oct 23 03:26 ls.exe
-rwxr-xr-x    1 bsmith     Administ   200192 Oct 23 03:26 m4.exe
-rwxr-xr-x    1 bsmith     Administ    27648 Oct 23 03:26 md5sum.exe
-rwxr-xr-x    1 bsmith     Administ    28672 Oct 23 03:26 mkdir.exe
-rwxr-xr-x    1 bsmith     Administ   108544 Oct 23 03:26 msmtp.exe
-rwxr-xr-x    1 bsmith     Administ   743240 Feb 10  2012 msys-1.0.dll
-rwxr-xr-x    1 bsmith     Administ  1325053 Jun 27  2012 msys-crypto-0.9
-rwxr-xr-x    1 bsmith     Administ    19968 Jun 27  2012 msys-minires.dl
-rwxr-xr-x    1 bsmith     Administ   939520 Jun 27  2012 msys-perl5_8.dl
-rwxr-xr-x    1 bsmith     Administ    82852 Jun 27  2012 msys-regex-1.dl
-rwxr-xr-x    1 bsmith     Administ   317994 Jun 27  2012 msys-ssl-0.9.8.
-rwxr-xr-x    1 bsmith     Administ    91792 Jun 27  2012 msys-z.dll
-rwxr-xr-x    1 bsmith     Administ    52064 Jun 27  2012 msysltdl-3.dll
-rwxr-xr-x    1 bsmith     Administ    81408 Oct 23 03:26 mv.exe
-rwxr-xr-x    1 bsmith     Administ   353280 Oct 23 03:26 openssl.exe
-rwxr-xr-x    1 bsmith     Administ    57344 Oct 23 03:26 patch.exe
-rw-r--r--    1 bsmith     Administ      570 Feb 28  2009 patch.exe.manif
-rwxr-xr-x    1 bsmith     Administ    28160 Oct 23 03:26 pdfinfo.exe
-rwxr-xr-x    1 bsmith     Administ    29184 Oct 23 03:26 pdftotext.exe
-rwxr-xr-x    1 bsmith     Administ     7168 Oct 23 03:26 perl.exe
-rwxr-xr-x    1 bsmith     Administ      175 Jun 27  2012 printf
-rwxr-xr-x    1 bsmith     Administ    10240 Oct 23 03:26 ps.exe
-rwxr-xr-x    1 bsmith     Administ    65124 Jun 27  2012 pthreadGC2.dll
-rwxr-xr-x    1 bsmith     Administ      169 Jun 27  2012 pwd
-rwxr-xr-x    1 bsmith     Administ   303616 Oct 23 03:26 rebase.exe
-rwxr-xr-x    1 bsmith     Administ     2137 Jun 27  2012 recodetree
-rwxr-xr-x    1 bsmith     Administ    62464 Oct 23 03:26 rm.exe
-rwxr-xr-x    1 bsmith     Administ    22528 Oct 23 03:26 rmdir.exe
-rwxr-xr-x    1 bsmith     Administ   102400 Oct 23 03:26 rxvt.exe
-rwxr-xr-x    1 bsmith     Administ    43008 Oct 23 03:26 scp.exe
-rwxr-xr-x    1 bsmith     Administ  1146880 Oct 23 03:26 sed.exe
-rwxr-xr-x    1 bsmith     Administ   540672 Oct 23 03:26 sh.exe
-rwxr-xr-x    1 bsmith     Administ    18432 Oct 23 03:26 sleep.exe
-rwxr-xr-x    1 bsmith     Administ    39936 Oct 23 03:26 sort.exe
-rwxr-xr-x    1 bsmith     Administ    23552 Oct 23 03:26 split.exe
-rwxr-xr-x    1 bsmith     Administ    81920 Oct 23 03:26 ssh-add.exe
-rwxr-xr-x    1 bsmith     Administ    69632 Oct 23 03:26 ssh-agent.exe
-rwxr-xr-x    1 bsmith     Administ   109056 Oct 23 03:26 ssh-keygen.exe
-rwxr-xr-x    1 bsmith     Administ   144384 Oct 23 03:26 ssh-keyscan.exe
-rwxr-xr-x    1 bsmith     Administ   256000 Oct 23 03:26 ssh.exe
-rwxr-xr-x    1 bsmith     Administ      192 Jun 27  2012 start
-rwxr-xr-x    1 bsmith     Administ    35840 Oct 23 03:26 tail.exe
-rwxr-xr-x    1 bsmith     Administ  1353728 Oct 23 03:26 tar.exe
-rwxr-xr-x    1 bsmith     Administ   843776 Jan 12  2012 tcl85.dll
-rwxr-xr-x    1 bsmith     Administ    16384 Jan 12  2012 tclpip85.dll
-rwxr-xr-x    1 bsmith     Administ     7680 Oct 23 03:26 tclsh.exe
-rwxr-xr-x    1 bsmith     Administ     7680 Oct 23 03:26 tclsh85.exe
-rwxr-xr-x    1 bsmith     Administ    19456 Oct 23 03:26 tee.exe
-rwxr-xr-x    1 bsmith     Administ  1011712 Jan 12  2012 tk85.dll
-rwxr-xr-x    1 bsmith     Administ    38400 Oct 23 03:26 touch.exe
-rwxr-xr-x    1 bsmith     Administ    33280 Oct 23 03:26 tr.exe
-rwxr-xr-x    1 bsmith     Administ    12288 Oct 23 03:26 true.exe
-rwxr-xr-x    1 bsmith     Administ    18944 Oct 23 03:26 uname.exe
-rwxr-xr-x    1 bsmith     Administ    24576 Oct 23 03:26 uniq.exe
-rwxr-xr-x    1 bsmith     Administ   159232 Oct 23 03:26 unzip.exe
-rwxr-xr-x    1 bsmith     Administ       45 Jun 27  2012 vi
-rwxr-xr-x    1 bsmith     Administ       45 Jun 27  2012 vim
-rwxr-xr-x    1 bsmith     Administ    32256 Oct 23 03:26 wc.exe
-rwxr-xr-x    1 bsmith     Administ      173 Jun 27  2012 which
-rwxr-xr-x    1 bsmith     Administ    10240 Oct 23 03:26 wish.exe
-rwxr-xr-x    1 bsmith     Administ    10240 Oct 23 03:26 wish85.exe
-rwxr-xr-x    1 bsmith     Administ    12288 Oct 23 03:26 xargs.exe
4

4 回答 4

0

您似乎在此项目中使用 Python 2.7,但您的错误消息:

UserWarning:未知的分发选项:'use_2to3' warnings.warn(msg) 错误:无法找到 vcvarsall.bat

指将 Python 2.x 转换为 Python 3.x 语法的 2to3 实用程序。

http://docs.python.org/2/library/2to3.html

您确定您正在使用适合您的操作系统的所有 Python 2.7 库吗?

于 2013-03-23T18:03:25.037 回答
0

我在网上找到了一个解决方案,但没有对其进行测试:安装 MinGW 。在 MinGW 的 bin 字典中找到 mingw32-make.exe,将其复制并重命名为 make.exe 其他过程与您的问题相同。

于 2013-03-18T03:38:28.320 回答
0

我最终能够使用https://zignar.net/2012/06/17/install-python-on-windows/找到答案。

谢谢你的帮助。事实证明,我现在明白 GIT-BASH 不包含 ming32w 包含的编译器。

问候,

账单

于 2013-03-28T16:59:50.377 回答
0

我有同样的错误;该帖子中解释的解决方案不起作用。
我的解决方案是安装cygwin并将其 python 用作我的 windows 的默认 python。

注意:cygwin 上 python 的默认版本是 2.6

于 2013-03-23T08:46:37.733 回答