[SOLUCIONADO] Pyinstaller no puede compilar mechanize con pyqt4

Iniciado por $francisco, Enero 02, 2016, 11:24:55 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Enero 02, 2016, 11:24:55 AM Ultima modificación: Enero 02, 2016, 10:43:46 PM por EPSILON
Muy buenas, resulta que al formatear mi pc me encuentro que al compilar una aplicación que tengo no me deja compilar mechanize, al ejecutar el programa una vez compilardo me lanza un error de returned -1 no moduled name mechanize y he leido muchas respuestas en google pero ninguna me ha funcionado.

Aqui os dejo el error haber si me podeis ayudar.

Código: php
import re,urllib2,mechanize,time
ImportError: No module named mechanize
main returned -1


Código: php
563 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_60a5df56e60dc5df.manifest
563 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_8550c6b5d18a9128.manifest
563 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_f480bfaef65491a5.manifest
579 INFO: Found C:\Windows\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9158_none_f47f259ef656232a.manifest
579 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9158)
797 INFO: Analyzing C:\Users\franciskiko\Desktop\hardcoremovie\main.py
3219 INFO: Looking for import hooks ...
3235 INFO: Processing hook   hook-httplib.py
3235 INFO: Processing hook   hook-PyQt4.py
3235 WARNING: Hidden import 'PyQt4._qt' not found (probably old hook)
3235 INFO: Processing hook   hook-encodings.py
3782 INFO: Processing hook   hook-PyQt4.QtGui.py
4219 WARNING: Hidden import 'PyQt4._qt' not found (probably old hook)
4219 INFO: Processing hook   hook-PyQt4.QtWebKit.py
4219 WARNING: Hidden import 'PyQt4._qt' not found (probably old hook)
4219 INFO: Processing hook   hook-PyQt4.phonon.py
4313 WARNING: Hidden import 'PyQt4._qt' not found (probably old hook)
4329 INFO: Processing hook   hook-PyQt4.QtCore.py
4407 WARNING: Hidden import 'PyQT4._qt' not found (probably old hook)
4422 INFO: Processing hook   hook-PyQt4.QtNetwork.py
4500 WARNING: Hidden import 'PyQt4._qt' not found (probably old hook)
4516 INFO: Looking for ctypes DLLs
4516 INFO: Analyzing run-time hooks ...
4532 INFO: Including run-time hook 'pyi_rth_qt4plugins.py'
4532 INFO: Looking for dynamic libraries
18115 INFO: Looking for eggs
18131 INFO: Using Python library C:\Windows\system32\python27.dll
18131 INFO: Found binding redirects:
[BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'x86', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 9158), publicKeyToken=u'1fc8b3b9a1e18e3b')]
18131 INFO: Warnings written to C:\Users\franciskiko\Desktop\hardcoremovie\build\main\warnmain.txt
18147 INFO: checking PYZ
18147 INFO: Building PYZ because out00-PYZ.toc is non existent
18147 INFO: Building PYZ (ZlibArchive) C:\Users\franciskiko\Desktop\hardcoremovie\build\main\out00-PYZ.pyz
18287 INFO: checking PKG
18287 INFO: Building PKG because out00-PKG.toc is non existent
18287 INFO: Building PKG (CArchive) out00-PKG.pkg
18324 INFO: Bootloader C:\Python27\lib\site-packages\pyinstaller-3.0-py2.7.egg\PyInstaller\bootloader\Windows-32bit\run.exe
18326 INFO: checking EXE
18327 INFO: Building EXE because out00-EXE.toc is non existent
18328 INFO: Building EXE from out00-EXE.toc
18331 INFO: Appending archive to EXE C:\Users\franciskiko\Desktop\hardcoremovie\build\main\main.exe
18349 INFO: checking COLLECT
18351 INFO: Building COLLECT because out00-COLLECT.toc is non existent
18353 INFO: Building COLLECT out00-COLLECT.toc
18386 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9158)

Hola @$francisco! Esto tendría que funcionar.

    1. Descargar el No tienes permitido ver los links. Registrarse o Entrar a mi cuenta.
    2. Extraer en C:\Python27\Lib\site-packages\ (quedaría C:\Python27\Lib\site-packages\mechanize-0.2.5\).
    3. Instalar mechanize: dentro del directorio mechanize-0.2.5, ejectuar el siguiente comando:

Código: batch
python setup.py install


    4. Buscar el archivo _mechanize.py (se encuentra en C:\Python27\Lib\site-packages\mechanize-0.2.5\mechanize\).
    5. Copiar el archivo al directorio C:\Python27\lib\site-packages\.
    6. Renombrar el archivo (quedaría C:\Python27\Lib\site-packages\mechanize.py).
    7. Crear el ejecutable:

Código: batch
python pyinstaller.py --onefile --console --paths=C:\Python27\Lib\site-packages\mechanize-0.2.5\ test.py


El código de No tienes permitido ver los links. Registrarse o Entrar a mi cuenta es el siguiente:
Código: python
import mechanize

print "Mechanize funcionando!"


Espero que te sirva!

Saludos!
WhiZ


Muchas gracias whiz!!! logre solucionarlo por fin, me diste una idea, el problema era que lo que compilaba es el archivo .egg y entonces lo unico que hice fue copiar el archivo mechanize dentro de el directorio mechanize-0.2.5 a el directorio site-packages y lo compila sin problemas  :D

Visto que solucionaste tu inconveniente cierro el tema, cualquier otra duda que tengas la posteas en "Dudas y pedidos generales".

Saludos!