Hallöchen zusammen!
Ich habe soeben den pyinstaller für Python 3.7 installiert.
Dazu musste ich zwar den absoluten Dateipfad verwenden, da
pip install pyinstaller
automatisch versucht hat den installer in dem Python 3.4 Ordner zu installieren, was (zumindest mit pip) nicht möglich ist.
Als ich dann versucht habe ein Skript in eine .exe Datei umzuwandeln mit
pyinstaller skript.py
kam folgendes:
Der Befehl "pyinstaller" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Hat jemand einen Lösungsvorschlag?
Problem mit PyInstaller
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
.\AppData\Local\Programs\Python\Python37-32
Ich hab mit
cd .\AppData\Local\Programs\Python\Python37-32
pip install pyinstaller
auch erfolgreich den installer installieren ( ) können... Ich frage mich jetzt aber wieso Ich ihn nicht aufrufen kann.
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
Ich habe jetzt das Skript in den Ordner in dem pip liegt verschieben müssen, um pyinstaller anwenden zu können.
Gut! Habe den Fehler gefunden! Hatte die falschen Umgebungsvariablen verwendet...
Jedoch habe Ich jetzt das nächste Problem. Und zwar lässt sich die entstandene .exe Datei nicht aufhühren...
Gut! Habe den Fehler gefunden! Hatte die falschen Umgebungsvariablen verwendet...
Jedoch habe Ich jetzt das nächste Problem. Und zwar lässt sich die entstandene .exe Datei nicht aufhühren...
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
Es kam bei dem benutzen von
pyinstaller skript.py
folgender Log:
PS C:\Users\User\Desktop\Programming\Python\Test> pyinstaller test.py
100 INFO: PyInstaller: 3.3.1
100 INFO: Python: 3.7.0
101 INFO: Platform: Windows-10-10.0.17134-SP0
102 INFO: wrote C:\Users\User\Desktop\Programming\Python\Test\test.spec
104 INFO: UPX is not available.
106 INFO: Extending PYTHONPATH with paths
['C:\\Users\\User\\Desktop\\Programming\\Python\\Test',
'C:\\Users\\User\\Desktop\\Programming\\Python\\Test']
106 INFO: checking Analysis
106 INFO: Building Analysis because out00-Analysis.toc is non existent
106 INFO: Initializing module dependency graph...
108 INFO: Initializing module graph hooks...
111 INFO: Analyzing base_library.zip ...
3220 INFO: running Analysis out00-Analysis.toc
3223 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\User\appdata\local\programs\python\python37-32\python.exe
3261 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3294 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3332 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3365 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3399 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3439 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3472 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3505 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3540 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3573 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3756 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3791 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3824 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3857 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3894 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3928 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3962 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4001 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4036 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4070 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4105 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4139 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4144 INFO: Caching module hooks...
4149 INFO: Analyzing C:\Users\User\Desktop\Programming\Python\Test\test.py
4153 INFO: Loading module hooks...
4154 INFO: Loading module hook "hook-encodings.py"...
4239 INFO: Loading module hook "hook-pydoc.py"...
4242 INFO: Loading module hook "hook-xml.py"...
4472 INFO: Looking for ctypes DLLs
4472 INFO: Analyzing run-time hooks ...
4480 INFO: Looking for dynamic libraries
4524 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_ssl.pyd
4562 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_ssl.pyd
4611 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4646 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4679 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4721 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4755 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4789 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4823 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4856 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4897 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_hashlib.pyd
4941 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
4975 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5009 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5044 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5081 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5124 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_lzma.pyd
5162 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_lzma.pyd
5207 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_socket.pyd
5248 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\select.pyd
5301 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5336 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5370 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5404 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
6336 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6377 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6411 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6445 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6479 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6513 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6546 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6583 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6617 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6655 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6659 INFO: Looking for eggs
6659 INFO: Using Python library c:\users\User\appdata\local\programs\python\python37-32\python37.dll
6660 INFO: Found binding redirects:
[]
6664 INFO: Warnings written to C:\Users\User\Desktop\Programming\Python\Test\build\test\warntest.txt
6713 INFO: Graph cross-reference written to C:\Users\User\Desktop\Programming\Python\Test\build\test\xref-test.html
6726 INFO: checking PYZ
6726 INFO: Building PYZ because out00-PYZ.toc is non existent
6726 INFO: Building PYZ (ZlibArchive) C:\Users\User\Desktop\Programming\Python\Test\build\test\out00-PYZ.pyz
7272 INFO: Building PYZ (ZlibArchive) C:\Users\User\Desktop\Programming\Python\Test\build\test\out00-PYZ.pyz completed successfully.
7281 INFO: checking PKG
7281 INFO: Building PKG because out00-PKG.toc is non existent
7281 INFO: Building PKG (CArchive) out00-PKG.pkg
7301 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
7303 INFO: Bootloader c:\users\User\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
7304 INFO: checking EXE
7305 INFO: Building EXE because out00-EXE.toc is non existent
7305 INFO: Building EXE from out00-EXE.toc
7306 INFO: Appending archive to EXE C:\Users\User\Desktop\Programming\Python\Test\build\test\test.exe
7312 INFO: Building EXE from out00-EXE.toc completed successfully.
7316 INFO: checking COLLECT
7316 INFO: Building COLLECT because out00-COLLECT.toc is non existent
7317 INFO: Building COLLECT out00-COLLECT.toc
7459 INFO: Building COLLECT out00-COLLECT.toc completed successfully.
PS C:\Users\User\Desktop\Programming\Python\Test>
und dann beim ausführen der .exe Datei kommt:
Fatal Python error: initfsencoding: unable to load the file system codec
zipimport.ZipImportError: can't find module 'encodings'
Current thread 0x000110f4 (most recent call first):
Am skript kann es definitiv nicht liegen es beinhaltet nur ein
pyinstaller skript.py
folgender Log:
PS C:\Users\User\Desktop\Programming\Python\Test> pyinstaller test.py
100 INFO: PyInstaller: 3.3.1
100 INFO: Python: 3.7.0
101 INFO: Platform: Windows-10-10.0.17134-SP0
102 INFO: wrote C:\Users\User\Desktop\Programming\Python\Test\test.spec
104 INFO: UPX is not available.
106 INFO: Extending PYTHONPATH with paths
['C:\\Users\\User\\Desktop\\Programming\\Python\\Test',
'C:\\Users\\User\\Desktop\\Programming\\Python\\Test']
106 INFO: checking Analysis
106 INFO: Building Analysis because out00-Analysis.toc is non existent
106 INFO: Initializing module dependency graph...
108 INFO: Initializing module graph hooks...
111 INFO: Analyzing base_library.zip ...
3220 INFO: running Analysis out00-Analysis.toc
3223 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\User\appdata\local\programs\python\python37-32\python.exe
3261 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3294 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3332 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3365 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3399 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3439 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3472 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3505 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3540 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3573 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3756 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3791 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3824 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3857 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3894 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3928 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3962 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4001 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4036 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4070 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4105 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4139 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4144 INFO: Caching module hooks...
4149 INFO: Analyzing C:\Users\User\Desktop\Programming\Python\Test\test.py
4153 INFO: Loading module hooks...
4154 INFO: Loading module hook "hook-encodings.py"...
4239 INFO: Loading module hook "hook-pydoc.py"...
4242 INFO: Loading module hook "hook-xml.py"...
4472 INFO: Looking for ctypes DLLs
4472 INFO: Analyzing run-time hooks ...
4480 INFO: Looking for dynamic libraries
4524 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_ssl.pyd
4562 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_ssl.pyd
4611 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4646 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4679 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4721 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4755 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4789 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4823 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4856 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4897 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_hashlib.pyd
4941 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
4975 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5009 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5044 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5081 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5124 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_lzma.pyd
5162 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_lzma.pyd
5207 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_socket.pyd
5248 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\select.pyd
5301 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5336 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5370 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5404 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
6336 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6377 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6411 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6445 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6479 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6513 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6546 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6583 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6617 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6655 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6659 INFO: Looking for eggs
6659 INFO: Using Python library c:\users\User\appdata\local\programs\python\python37-32\python37.dll
6660 INFO: Found binding redirects:
[]
6664 INFO: Warnings written to C:\Users\User\Desktop\Programming\Python\Test\build\test\warntest.txt
6713 INFO: Graph cross-reference written to C:\Users\User\Desktop\Programming\Python\Test\build\test\xref-test.html
6726 INFO: checking PYZ
6726 INFO: Building PYZ because out00-PYZ.toc is non existent
6726 INFO: Building PYZ (ZlibArchive) C:\Users\User\Desktop\Programming\Python\Test\build\test\out00-PYZ.pyz
7272 INFO: Building PYZ (ZlibArchive) C:\Users\User\Desktop\Programming\Python\Test\build\test\out00-PYZ.pyz completed successfully.
7281 INFO: checking PKG
7281 INFO: Building PKG because out00-PKG.toc is non existent
7281 INFO: Building PKG (CArchive) out00-PKG.pkg
7301 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
7303 INFO: Bootloader c:\users\User\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
7304 INFO: checking EXE
7305 INFO: Building EXE because out00-EXE.toc is non existent
7305 INFO: Building EXE from out00-EXE.toc
7306 INFO: Appending archive to EXE C:\Users\User\Desktop\Programming\Python\Test\build\test\test.exe
7312 INFO: Building EXE from out00-EXE.toc completed successfully.
7316 INFO: checking COLLECT
7316 INFO: Building COLLECT because out00-COLLECT.toc is non existent
7317 INFO: Building COLLECT out00-COLLECT.toc
7459 INFO: Building COLLECT out00-COLLECT.toc completed successfully.
PS C:\Users\User\Desktop\Programming\Python\Test>
und dann beim ausführen der .exe Datei kommt:
Fatal Python error: initfsencoding: unable to load the file system codec
zipimport.ZipImportError: can't find module 'encodings'
Current thread 0x000110f4 (most recent call first):
Am skript kann es definitiv nicht liegen es beinhaltet nur ein
Code: Alles auswählen
print("hello world")
- __blackjack__
- User
- Beiträge: 13111
- Registriert: Samstag 2. Juni 2018, 10:21
- Wohnort: 127.0.0.1
- Kontaktdaten:
Python 3.7 wird von PyInstaller noch nicht unterstützt: https://github.com/pyinstaller/pyinstal ... -402650525
„All religions are the same: religion is basically guilt, with different holidays.” — Cathy Ladman
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
Ja das weiß ich.. jedoch passiert das gleiche mit 3.4, 3.5 und 3.6, nur erscheint dann dieser Error nicht:__blackjack__ hat geschrieben: ↑Mittwoch 29. August 2018, 12:19 Python 3.7 wird von PyInstaller noch nicht unterstützt: https://github.com/pyinstaller/pyinstal ... -402650525
Fatal Python error: initfsencoding: unable to load the file system codec
zipimport.ZipImportError: can't find module 'encodings'
Current thread 0x000110f4 (most recent call first):
- __blackjack__
- User
- Beiträge: 13111
- Registriert: Samstag 2. Juni 2018, 10:21
- Wohnort: 127.0.0.1
- Kontaktdaten:
Hast Du irgendwelche Umgebungsvariablen definiert deren Name mit PYTHON anfängt? PYTHONPATH und/oder PYTHONHOME insbesondere?
„All religions are the same: religion is basically guilt, with different holidays.” — Cathy Ladman
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
path=C:\Users\User\AppData\Local\Programs\Python\Python35
path=C:\Users\User\AppData\Local\Programs\Python\Python35\Scripts
und
PYTHON_HOME=C:\Users\User\AppData\Local\Programs\Python\Python35
path=C:\Users\User\AppData\Local\Programs\Python\Python35\Scripts
und
PYTHON_HOME=C:\Users\User\AppData\Local\Programs\Python\Python35
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
Es erscheint nach dem entfernen der Umgebungsvariable zwar immer noch:
Jedoch lässt sich die .exe für den Bruchteil einer Sekunde ausführen und liefert sogar ein richtiges Ergebnis, bricht dann aber mit einem UnicodeEncodeError ab.Chr0medome hat geschrieben: ↑Mittwoch 29. August 2018, 12:09
PS C:\Users\User\Desktop\Programming\Python\Test> pyinstaller test.py
100 INFO: PyInstaller: 3.3.1
100 INFO: Python: 3.7.0
101 INFO: Platform: Windows-10-10.0.17134-SP0
102 INFO: wrote C:\Users\User\Desktop\Programming\Python\Test\test.spec
104 INFO: UPX is not available.
106 INFO: Extending PYTHONPATH with paths
['C:\\Users\\User\\Desktop\\Programming\\Python\\Test',
'C:\\Users\\User\\Desktop\\Programming\\Python\\Test']
106 INFO: checking Analysis
106 INFO: Building Analysis because out00-Analysis.toc is non existent
106 INFO: Initializing module dependency graph...
108 INFO: Initializing module graph hooks...
111 INFO: Analyzing base_library.zip ...
3220 INFO: running Analysis out00-Analysis.toc
3223 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\User\appdata\local\programs\python\python37-32\python.exe
3261 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3294 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3332 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3365 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3399 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python.exe
3439 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3472 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3505 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3540 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3573 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
3756 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3791 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3824 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3857 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3894 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3928 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
3962 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4001 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4036 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4070 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4105 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4139 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\python37.dll
4144 INFO: Caching module hooks...
4149 INFO: Analyzing C:\Users\User\Desktop\Programming\Python\Test\test.py
4153 INFO: Loading module hooks...
4154 INFO: Loading module hook "hook-encodings.py"...
4239 INFO: Loading module hook "hook-pydoc.py"...
4242 INFO: Loading module hook "hook-xml.py"...
4472 INFO: Looking for ctypes DLLs
4472 INFO: Analyzing run-time hooks ...
4480 INFO: Looking for dynamic libraries
4524 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_ssl.pyd
4562 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_ssl.pyd
4611 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4646 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4679 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\unicodedata.pyd
4721 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4755 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4789 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4823 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4856 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\pyexpat.pyd
4897 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_hashlib.pyd
4941 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
4975 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5009 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5044 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5081 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_bz2.pyd
5124 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_lzma.pyd
5162 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_lzma.pyd
5207 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\_socket.pyd
5248 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\select.pyd
5301 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5336 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5370 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
5404 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libssl-1_1.dll
6336 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6377 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6411 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6445 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6479 WARNING: lib not found: api-ms-win-crt-utility-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6513 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6546 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6583 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6617 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6655 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\User\appdata\local\programs\python\python37-32\DLLs\libcrypto-1_1.dll
6659 INFO: Looking for eggs
6659 INFO: Using Python library c:\users\User\appdata\local\programs\python\python37-32\python37.dll
6660 INFO: Found binding redirects:
[]
6664 INFO: Warnings written to C:\Users\User\Desktop\Programming\Python\Test\build\test\warntest.txt
6713 INFO: Graph cross-reference written to C:\Users\User\Desktop\Programming\Python\Test\build\test\xref-test.html
6726 INFO: checking PYZ
6726 INFO: Building PYZ because out00-PYZ.toc is non existent
6726 INFO: Building PYZ (ZlibArchive) C:\Users\User\Desktop\Programming\Python\Test\build\test\out00-PYZ.pyz
7272 INFO: Building PYZ (ZlibArchive) C:\Users\User\Desktop\Programming\Python\Test\build\test\out00-PYZ.pyz completed successfully.
7281 INFO: checking PKG
7281 INFO: Building PKG because out00-PKG.toc is non existent
7281 INFO: Building PKG (CArchive) out00-PKG.pkg
7301 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
7303 INFO: Bootloader c:\users\User\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
7304 INFO: checking EXE
7305 INFO: Building EXE because out00-EXE.toc is non existent
7305 INFO: Building EXE from out00-EXE.toc
7306 INFO: Appending archive to EXE C:\Users\User\Desktop\Programming\Python\Test\build\test\test.exe
7312 INFO: Building EXE from out00-EXE.toc completed successfully.
7316 INFO: checking COLLECT
7316 INFO: Building COLLECT because out00-COLLECT.toc is non existent
7317 INFO: Building COLLECT out00-COLLECT.toc
7459 INFO: Building COLLECT out00-COLLECT.toc completed successfully.
PS C:\Users\User\Desktop\Programming\Python\Test>
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
Das Programm sieht folgendermaßen aus:
Es soll die aktuellen Schrottpreise von https://www.schrottankauf-bitterfelders ... preise.php parsen.
Wenn ich es über die Shell ausführe läuft es einwandfrei. Starte ich es aber z.B. über cmd oder Windows PowerShell kommt folgender Output:
Der Fehler erscheint auch wenn Ich die .exe ausführe.
Code: Alles auswählen
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
def parse_all(url): #extrcting whole source code from website
response = requests.get(url)
if response.status_code == 200: #checks status code of website, 200 = existing and reachable
doc = BeautifulSoup(response.text, "html.parser")
return doc
else: #reuturns error if the website is eg. not reachable
print("Something went wrong", response.status_code)
def parse_specific(src_code, tag): #extracting specific part of the source code
element = src_code.find(tag)
return element
import get_src_code #Es sind zwei einzelne Programme, die vorherigen beiden Funktionen sind in einer anderen Datei
def formatting(src_code):
prices = []
elements = []
category = ["€ / Tonne ab 500 kg", "€ / Tonne ab 1000 kg", "€ / kg"]
for tr in src_code.find_all("tr"):
elements.append(tr)
for element in elements:
for p in element.find_all("p"):
print("\n" + p.text + "\n")
for strong in element.find_all("strong"):
prices.append(strong.text)
index = 0
while index < 3:
print(prices[index].strip() + category[index])
index += 1
prices = []
url = "https://www.schrottankauf-bitterfelderstr23.de/schrottpreise.php"
code = get_src_code.parse_specific(get_src_code.parse_all(url), "table")
formatting(code)
Wenn ich es über die Shell ausführe läuft es einwandfrei. Starte ich es aber z.B. über cmd oder Windows PowerShell kommt folgender Output:
Code: Alles auswählen
Traceback (most recent call last):
File "schrottpreise.py", line 24, in <module>
formatting(code)
File "schrottpreise.py", line 18, in formatting
print(prices[index].strip() + category[index])
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\encodings\cp850.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u20ac' in position 6: character maps to <undefined>
Das ist ein Euro-Zeichen. Und cp850 kann das noch nicht. Du musst das auf eine andere code-page aendern, die das kann, und die gleichzeitig von deinem Terminal unterstuetzt wird. Wahrscheinlich cp1252.
Dazu am Anfang deines Programms sowas einfuegen:
Dazu am Anfang deines Programms sowas einfuegen:
Code: Alles auswählen
sys.stdout = codecs.getwriter("cp1252")(sys.stdout.detach())
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
Vielen Dank für den Vorschlag nur leider kenne ich mich mit den Coding Pages nicht aus und werde aus deinem snippet nicht schlau...
Ich habe sys und codecs importiert und
an den Anfang getan
und
an das Ende. Nun erscheint folgender Fehler:
mache ich
An den Anfang kommt:
Ich habe sys und codecs importiert und
Code: Alles auswählen
sys.stdout = codecs.getwriter("cp1252")
und
Code: Alles auswählen
sys.stdout.detach()
Code: Alles auswählen
Traceback (most recent call last):
File "C:\Users\User\Desktop\Python\Company\Schrottpreise\schrottpreise.py", line 26, in <module>
formatting(code)
File "C:\Users\User\Desktop\Python\Company\Schrottpreise\schrottpreise.py", line 14, in formatting
print("\n" + p.text + "\n")
TypeError: write() missing 1 required positional argument: 'object'
Code: Alles auswählen
sys.stdout = codecs.getwriter("cp1252")(sys.stdout.detach())
Code: Alles auswählen
Traceback (most recent call last):
File "C:\Users\User\Desktop\Python\Company\Schrottpreise\schrottpreise.py", line 2, in <module>
sys.stdout = codecs.getwriter("cp1252")(sys.stdout.detach())
io.UnsupportedOperation: detach
- __blackjack__
- User
- Beiträge: 13111
- Registriert: Samstag 2. Juni 2018, 10:21
- Wohnort: 127.0.0.1
- Kontaktdaten:
Um das noch mal klar zu sagen: Das ist kein Problem von Python oder PyInstaller. Du versuchst das Programm in einem Konsolenfenster auszuführen das einfach nicht in der Lage ist alle Zeichen zu verstehen die Dein Programm ausgibt. Jedenfalls nicht so wie es konfiguriert ist. Und cp850 ist die normale Konfiguration.
Die Fehlermeldung bei `detach()` bekommst Du in der Konsole oder in IDLE oder einer anderen IDE?
Ist ein schönes Beispiel dafür das mit Python 3 Unicode letztlich kein Stück einfacher für Anfänger geworden ist. Wenn man Programme haben möchte die nicht doch irgendwann auf die Nase fallen, muss man sich letztlich doch um das Thema kümmern, es verstehen, und explizit Code dafür schreiben oder welchen finden.
Vielleicht ist ja die `echo()`-Funktion von `click` etwas: http://click.pocoo.org/5/quickstart/#echoing
Die Fehlermeldung bei `detach()` bekommst Du in der Konsole oder in IDLE oder einer anderen IDE?
Ist ein schönes Beispiel dafür das mit Python 3 Unicode letztlich kein Stück einfacher für Anfänger geworden ist. Wenn man Programme haben möchte die nicht doch irgendwann auf die Nase fallen, muss man sich letztlich doch um das Thema kümmern, es verstehen, und explizit Code dafür schreiben oder welchen finden.
Vielleicht ist ja die `echo()`-Funktion von `click` etwas: http://click.pocoo.org/5/quickstart/#echoing
„All religions are the same: religion is basically guilt, with different holidays.” — Cathy Ladman
-
- User
- Beiträge: 30
- Registriert: Freitag 20. Juli 2018, 15:39
Das liefert den Error:__blackjack__ hat geschrieben: ↑Mittwoch 29. August 2018, 22:16 Vielleicht ist ja die `echo()`-Funktion von `click` etwas: http://click.pocoo.org/5/quickstart/#echoing
Code: Alles auswählen
Traceback (most recent call last):
File "C:\Users\User\Desktop\Python\Company\Schrottpreise\schrottpreise.py", line 25, in <module>
formatting(code)
File "C:\Users\User\Desktop\Python\Company\Schrottpreise\schrottpreise.py", line 13, in formatting
click.echo("\n" + p.text + "\n")
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\click\utils.py", line 217, in echo
file = _default_text_stdout()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\click\_compat.py", line 621, in func
rv = wrapper_func()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\click\_compat.py", line 385, in get_text_stdout
rv = _get_windows_console_stream(sys.stdout, encoding, errors)
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\click\_winconsole.py", line 261, in _get_windows_console_stream
func = _stream_factories.get(f.fileno())
io.UnsupportedOperation: fileno
Die bekomme ich in IDLE__blackjack__ hat geschrieben: ↑Mittwoch 29. August 2018, 22:16 Die Fehlermeldung bei `detach()` bekommst Du in der Konsole oder in IDLE oder einer anderen IDE?