Сбой установки pip-пакета python, ошибка dllwrap после «исправления»: «невозможно найти vcvarsall.bat» - PullRequest
4 голосов
/ 26 марта 2011

Я не могу найти это в архивах. Что-то не так с mingw / msys? [Мне нужно исправить vcvarsall.bat, чтобы я мог устанавливать другие пакеты.]

Не удалось установить пакет python, «закрученный» с помощью pip.exe.

У меня установлены python2.6 и mingw / msys. % PATH% включает C:\MinGW\ и C:\MinGW\mingw32\bin

first: pip.exe install twisted терпит неудачу, говоря error: Unable to find vcvarsall.bat Я создаю файл G:\Programs (x86)\Python 2.6\Lib\distutils\distutils.cfg, который содержит:

[build]
compiler=mingw32

Теперь я получаю ошибку:

g:\Programs (x86)\Python 2.6>python Scripts\pip-script.py install twisted
Downloading/unpacking twisted
  Running setup.py egg_info for package twisted
Downloading/unpacking zope.interface (from twisted)
  Running setup.py egg_info for package zope.interface
Requirement already satisfied (use --upgrade to upgrade): setuptools in g:\progr
ams (x86)\python 2.6\lib\site-packages (from zope.interface->twisted)
Installing collected packages: twisted, zope.interface
  Running setup.py install for twisted
    C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall "-Ig:\Programs (x86)\Python
2.6\include" "-Ig:\Programs (x86)\Python 2.6\PC" -c conftest.c -o conftest.o
    conftest.c:1:21: fatal error: rpc/rpc.h: No such file or directory
    compilation terminated.
    C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall "-Ig:\Programs (x86)\Python
2.6\include" "-Ig:\Programs (x86)\Python 2.6\PC" -c conftest.c -o conftest.o
    conftest.c:1:23: fatal error: sys/epoll.h: No such file or directory
    compilation terminated.
    building 'twisted.protocols._c_urlarg' extension
    C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DWIN32=1 "-Ig:\Programs (x8
6)\Python 2.6\include" "-Ig:\Programs (x86)\Python 2.6\PC" -c twisted/protocols/
_c_urlarg.c -o build\temp.win32-2.6\Release\twisted\protocols\_c_urlarg.o
    twisted/protocols/_c_urlarg.c: In function 'unquote':
    twisted/protocols/_c_urlarg.c:41:50: warning: 'tmp' may be used uninitialize
d in this function
    C:\MinGW\bin\dllwrap.exe -mno-cygwin -mdll -static --output-lib build\temp.w
in32-2.6\Release\twisted\protocols\lib_c_urlarg.a --def build\temp.win32-2.6\Rel
ease\twisted\protocols\_c_urlarg.def -s build\temp.win32-2.6\Release\twisted\pro
tocols\_c_urlarg.o "-Lg:\Programs (x86)\Python 2.6\libs" "-Lg:\Programs (x86)\Py
thon 2.6\PCbuild" -lpython26 -lmsvcr90 -o build\lib.win32-2.6\twisted\protocols\
_c_urlarg.pyd
    _c_urlarg.exp: file not recognized: File format not recognized
    collect2: ld returned 1 exit status
    dllwrap: gcc exited with status 1
    error: command 'dllwrap' failed with exit status 1
    Complete output from command "g:\Programs (x86)\Python 2.6\python.exe" -c "i
mport setuptools;__file__='g:\\Programs (x86)\\Python 2.6\\build\\twisted\\setup
.py';execfile(__file__)" install --single-version-externally-managed --record c:
\users\jake\appdata\local\temp\pip-3y_c1e-record\install-record.txt:
    running install

running build

running build_py

running egg_info

writing requirements to Twisted.egg-info\requires.txt

writing Twisted.egg-info\PKG-INFO

writing top-level names to Twisted.egg-info\top_level.txt

writing dependency_links to Twisted.egg-info\dependency_links.txt

reading manifest file 'Twisted.egg-info\SOURCES.txt'

writing manifest file 'Twisted.egg-info\SOURCES.txt'

running build_ext

C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall "-Ig:\Programs (x86)\Python 2.6\
include" "-Ig:\Programs (x86)\Python 2.6\PC" -c conftest.c -o conftest.o

conftest.c:1:21: fatal error: rpc/rpc.h: No such file or directory

compilation terminated.

C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall "-Ig:\Programs (x86)\Python 2.6\
include" "-Ig:\Programs (x86)\Python 2.6\PC" -c conftest.c -o conftest.o

conftest.c:1:23: fatal error: sys/epoll.h: No such file or directory

compilation terminated.

building 'twisted.protocols._c_urlarg' extension

C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DWIN32=1 "-Ig:\Programs (x86)\P
ython 2.6\include" "-Ig:\Programs (x86)\Python 2.6\PC" -c twisted/protocols/_c_u
rlarg.c -o build\temp.win32-2.6\Release\twisted\protocols\_c_urlarg.o

twisted/protocols/_c_urlarg.c: In function 'unquote':

twisted/protocols/_c_urlarg.c:41:50: warning: 'tmp' may be used uninitialized in
 this function

writing build\temp.win32-2.6\Release\twisted\protocols\_c_urlarg.def

C:\MinGW\bin\dllwrap.exe -mno-cygwin -mdll -static --output-lib build\temp.win32
-2.6\Release\twisted\protocols\lib_c_urlarg.a --def build\temp.win32-2.6\Release
\twisted\protocols\_c_urlarg.def -s build\temp.win32-2.6\Release\twisted\protoco
ls\_c_urlarg.o "-Lg:\Programs (x86)\Python 2.6\libs" "-Lg:\Programs (x86)\Python
 2.6\PCbuild" -lpython26 -lmsvcr90 -o build\lib.win32-2.6\twisted\protocols\_c_u
rlarg.pyd

_c_urlarg.exp: file not recognized: File format not recognized

collect2: ld returned 1 exit status

dllwrap: gcc exited with status 1

warning: manifest_maker: standard file '-c' not found

error: command 'dllwrap' failed with exit status 1

----------------------------------------
Command "g:\Programs (x86)\Python 2.6\python.exe" -c "import setuptools;__file__
='g:\\Programs (x86)\\Python 2.6\\build\\twisted\\setup.py';execfile(__file__)"
install --single-version-externally-managed --record c:\users\jake\appdata\local
\temp\pip-3y_c1e-record\install-record.txt failed with error code 1
Storing complete log in C:\Users\jake\AppData\Roaming\pip\pip.log

Ответы [ 3 ]

3 голосов
/ 22 июня 2012

Вопрос: почему dllwrap выдает эту ошибку в пипсах?

_foo.exp: file not recognized: File format not recognized

Краткий ответ: проверьте свой PATH.MinGW \ bin должен быть ближе к началу.

Длинный ответ: Некоторое время я использовал обходной путь.Я взял команду dllwrap из pip.log и выполнил ее напрямую.Это завершило работу .pyd и позволило установить pip для завершения работы.

Я передал флаг --verbose этим двум различным способам вызова dllwrap.Под пипом это делалось.

dlltool: Opened temporary file: dumlc.s
dlltool: run: as   -o _bcrypt.exp dumlc.s
dlltool: Generated exports file

Вызов dllwrap из командной строки дал это.

C:\MinGW\bin\dlltool: Opened temporary file: demmc.s
C:\MinGW\bin\dlltool: run: C:\MinGW\bin\as   -o _bcrypt.exp demmc.s
C:\MinGW\bin\dlltool: Generated exports file

Мой компьютер работает под управлением Windows 7 64-bit, но с 32-bit Python 2.7,Это новое, но, похоже, предустановленный AMD APP SDK.Это as.exe, который по умолчанию имеет 64-битный вывод.

Я решил исправить PATH так, чтобы C: \ MinGW \ bin опережал C: \ Program Files (x86) \ AMD APP \bin \ x86_64

Эта проблема может быть исправлена ​​более надежно в коде Python, хотя я не определил, где в virtualenv, pip или distutils это следует сделать.

Есть еще две вещи, которые необходимодля создания расширений с использованием MinGW, который я здесь кратко повторю.

Настройте distutils для использования компилятора MinGW

Это может быть сделано в различных файлах или параметрах командной строки.Я выбрал файл в своем домашнем каталоге.

$ cat ~/pydistutils.cfg
[build]
compiler = mingw32

Патч distutils для исключения ключа -mno-cygwin

Как администратор отредактируйте Lib / distutils / cygwinccompiler.py.Удалите четыре параметра -mno-cygwin.

s/ -mno-cygwin//

-mno-cygwin устарел в gcc некоторое время и теперь является ошибкой.

См. http://bugs.python.org/issue12641

3 голосов
/ 26 марта 2011

Вероятно, это ошибка в Python. Смотри http://bugs.python.org/issue2698

Между тем, вы можете установить ActivePython и установить Twisted через PyPM (без компиляторов).

В качестве альтернативы вы можете использовать официальный двоичный файл ... хотя я рекомендую вышеупомянутое решение, поскольку в будущем вы можете легко «обновиться» до новых версий Twisted.

0 голосов
/ 05 февраля 2013

В Windows я установил Visual Studio 2008 (vcsetup.exe), чтобы обойти эту проблему.

обновленная ссылка: http://www.microsoft.com/en-us/download/details.aspx?id=15336

При использовании Python 3.3 вы можете использовать Visual Studio 2010

...