python pyinstaller

python - PyInstaller ADVERTENCIA: lib no encontrado



(9)

Sé que este tipo de preguntas se han hecho aquí antes, pero no encontré una solución que funcione. Tengo un archivo de Python que quiero convertir a un exe en Windows 10. pyinstaller --onefile --noconsole myfile.py , y pyinstaller --onefile --noconsole myfile.py muchas advertencias:

C:/Users/conne/Desktop/Python >pyinstaller --onefile --noconsole normal.py 277 INFO: PyInstaller: 3.3.1 277 INFO: Python: 3.6.2 278 INFO: Platform: Windows-10-10.0.15063-SP0 279 INFO: wrote C:/Users/conne/Desktop/Python/normal.spec 280 INFO: UPX is not available. 283 INFO: Extending PYTHONPATH with paths [''C://Users//conne//Desktop//python'', ''C://Users//conne//Desktop//python''] 283 INFO: checking Analysis 284 INFO: Building Analysis because out00-Analysis.toc is non existent 284 INFO: Initializing module dependency graph... 286 INFO: Initializing module graph hooks... 289 INFO: Analyzing base_library.zip ... 5055 INFO: running Analysis out00-Analysis.toc 5058 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable required by c:/users/conne/appdata/local/programs/python/python36/python.exe 5145 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python.exe 5225 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python.exe 5298 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python.exe 5371 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python.exe 5442 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python.exe 5526 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/VCRUNTIME140.dll 5598 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/VCRUNTIME140.dll 5669 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/VCRUNTIME140.dll 5753 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/VCRUNTIME140.dll 5840 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/VCRUNTIME140.dll 6061 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6134 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6208 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6282 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6354 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6430 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6503 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6576 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6651 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6725 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6798 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6879 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/python36.dll 6882 INFO: Caching module hooks... 6892 INFO: Analyzing C:/Users/conne/Desktop/python meterpreter/normal.py 6898 INFO: Loading module hooks... 6899 INFO: Loading module hook "hook-encodings.py"... 7055 INFO: Loading module hook "hook-pydoc.py"... 7057 INFO: Loading module hook "hook-xml.py"... 7351 INFO: Looking for ctypes DLLs 7351 INFO: Analyzing run-time hooks ... 7360 INFO: Looking for dynamic libraries 7439 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 7515 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 7589 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 7660 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 7731 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 7813 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 7895 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 7968 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 8051 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 8133 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_ssl.pyd 8213 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/unicodedata.pyd 8286 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/unicodedata.pyd 8361 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/unicodedata.pyd 8440 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/pyexpat.pyd 8512 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/pyexpat.pyd 8585 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/pyexpat.pyd 8658 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/pyexpat.pyd 8741 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 8815 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 8887 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 8958 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 9032 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 9116 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 9194 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 9271 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 9344 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_hashlib.pyd 9428 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_bz2.pyd 9501 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_bz2.pyd 9580 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_bz2.pyd 9651 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_bz2.pyd 9723 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_bz2.pyd 9801 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_lzma.pyd 9874 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_lzma.pyd 9959 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_socket.pyd 10030 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/_socket.pyd 10115 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:/users/conne/appdata/local/programs/python/python36/DLLs/select.pyd 10123 INFO: Looking for eggs 10123 INFO: Using Python library c:/users/conne/appdata/local/programs/python/python36/python36.dll 10124 INFO: Found binding redirects: [] 10128 INFO: Warnings written to C:/Users/conne/Desktop/python/build/normal/warnnormal.txt 10196 INFO: Graph cross-reference written to C:/Users/conne/Desktop/python/build/normal/xref-normal.html 10212 INFO: checking PYZ 10212 INFO: Building PYZ because out00-PYZ.toc is non existent 10213 INFO: Building PYZ (ZlibArchive) C:/Users/conne/Desktop/python/build/normal/out00-PYZ.pyz 10948 INFO: Building PYZ (ZlibArchive) C:/Users/conne/Desktop/python/build/normal/out00-PYZ.pyz completed successfully. 10958 INFO: checking PKG 10958 INFO: Building PKG because out00-PKG.toc is non existent 10959 INFO: Building PKG (CArchive) out00-PKG.pkg 12884 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully. 12887 INFO: Bootloader c:/users/conne/appdata/local/programs/python/python36/lib/site-packages/PyInstaller/bootloader/Windows-64bit/runw.exe 12887 INFO: checking EXE 12888 INFO: Building EXE because out00-EXE.toc is non existent 12888 INFO: Building EXE from out00-EXE.toc 12916 INFO: Appending archive to EXE C:/Users/conne/Desktop/python meterpreter/dist/normal.exe 13011 INFO: Building EXE from out00-EXE.toc completed successfully.

Como puede ver, el exe se creó con éxito, pero no funciona como debería cuando se ejecuta.

EDITAR: Lo ejecuté con la depuración habilitada y aparentemente no puede importar tipos, arroja un error de nombre. Solo hace esto cuando se ejecuta con pyinstaller, cuando se ejecuta como un archivo .py funciona bien.


26095 ADVERTENCIA: lib no encontrado: api-ms-win-crt-runtime-l1-1-0.dll dependencia de c: / users / user / appdata / local / programs / python / python36-32 / DLLs / select.pyd

Busque en C: conducir dll y configure la ruta en el comando pyinstaller. El siguiente comando solucionó el error de pyinstaller anterior en Windows 10:

pyinstaller --paths C:/Windows/WinSxS/x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_10.0.17134.1_none_50c6cb8431e7428f hello.py


Acabo de agregar la ruta en la variable ambiental, funcionó para mí.

C: / Archivos de programa (x86) / Windows Kits / 10 / Redist / ucrt / DLLs / x64

(o)

C: / Archivos de programa (x86) / Windows Kits / 10 / Redist / ucrt / DLLs / x86


Cuando hay una gran cantidad de ADVERTENCIAS provenientes de pyinstaller sobre la imposibilidad de localizar las DLL de Windows, puede verificar si están en una de las dos ubicaciones siguientes:

C:/Windows/System32/downlevel C:/Windows/SysWOW64/downlevel

Puede agregar uno o ambos a la variable PATH, así, y esas advertencias deberían desaparecer:

set PATH=%PATH%;C:/Windows/System32/downlevel

Menciono esto porque es más fácil que encontrar y copiar los archivos DLL en una carpeta en la ruta como Alex F mencionó. También noté que algunas de las DLL que no puede localizar están en las carpetas que llamé anteriormente.


Deberá instalar uno de los paquetes de Visual C ++ a continuación según la arquitectura de su sistema.

Las últimas descargas compatibles de Visual C ++

Visual Studio 2015, 2017 y 2019

Descargue Microsoft Visual C ++ Redistributable para Visual Studio 2015, 2017 y 2019 . Las siguientes actualizaciones son los últimos paquetes redistribuibles de Visual C ++ compatibles para Visual Studio 2015, 2017 y 2019. Se incluye una versión de referencia de Universal C Runtime; consulte MSDN para obtener más información.

Nota: Visual C ++ 2015, 2017 y 2019 comparten todos los mismos archivos redistribuibles.

Por ejemplo, la instalación del redistribuible de Visual C ++ 2019 también afectará a los programas creados con Visual C ++ 2015 y 2017. Sin embargo, la instalación del redistribuible de Visual C ++ 2015 no reemplazará las versiones más recientes de los archivos instalados por los redistribuibles de Visual C ++ 2017 y 2019.

Esto es diferente de todas las versiones anteriores de Visual C ++, ya que cada una tenía sus propios archivos de tiempo de ejecución distintos, no compartidos con otras versiones.

Visual Studio 2013 (VC ++ 12.0)

Para obtener más información, consulte C ++ Runtime for Sideloaded Windows 8.1 apps en el blog del equipo VC ++ .

Visual Studio 2012 (VC ++ 11.0)

Descargue los paquetes redistribuibles de Microsoft Visual C ++ para Visual Studio 2012 Update 4 . Este es el último paquete redistribuible de Visual C ++ compatible para Visual Studio 2012.

Visual Studio 2010 (VC ++ 10.0) SP1

Visual Studio 2008 (VC ++ 9.0) SP1

Source


Encontré los archivos DLL en system32 / downlevel y syswow64 / downlevel y los copié a las carpetas principales respectivas (system32 y syswow64). Algo que hará el mandato de Ritesh Singh. Intente reiniciar después de copiar si aún no funciona.


Me encontré con este problema y ninguna de las acciones documentadas de reparación de pyinstaller funcionó. Pude resolver esto descargando las DLL (las obtuve del paquete SDK) y copiándolas en system32 y sysWOW64. ¡Todos los programas ahora son compatibles con versiones anteriores!


Por alguna razón, arrojó un NameError al importar ctypes, al agregar esta línea al comando pyinstaller se resolvió el problema: --hidden-import ctypes


Siga los siguientes pasos para resolver el problema "ADVERTENCIA de PyInstaller: lib no encontrado: SOLUCIÓN api-ms-win-crt" :

  1. ejecute la siguiente línea de comando en el símbolo del sistema o Windows Power-Shell
  2. pyinstaller --windowed --paths C: / Windows / System32 / downlevel application_name.py

Se puede encontrar información adicional here en el sitio web de MS.


Tenga en cuenta que a partir del 4/3/2019, la versión de desarrollo actual de pyinstaller 3.5 no muestra estas advertencias. (3.5.dev0 + g8c27d266)

pip install git+https://github.com/pyinstaller/pyinstaller.git