BG Development


  Reply to this topicStart new topicStart Poll

> Kali Linux - from .py to .exe (PROBLEM)
WorldUPP
Публикувано на: 30-10-2022, 13:06
Quote Post



Име:
Група: Потребител
Ранг: Новопостъпил

Мнения: 17
Регистриран на: 28.10.22



Здравейте,
искам да направя питон скрипта си в .екзе.Ползвам pyinstaller,но дава някаква грешка..Някой да знае какво се случва?

SCRIPT:
CODE
from cryptography.fernet import Fernet;
global theString;
global usersChoice;
global key;
key = Fernet.generate_key();
def takeFavoriteNumber():
   global usersChoice;
   choice = input("Hello, hustler.Please, enter your favorite number from 0 to 9:");
   usersChoice = choice;
def createTheStringCode():
   global usersChoice;
   global theString;
   randomCode = "";
   counter = 0;
   while counter < 10:
       randomCode = randomCode + str(usersChoice) + str(counter*2);
       counter = counter + 1;
   theString = randomCode;
   print(theString);
takeFavoriteNumber();
createTheStringCode();
key = key + bytes((theString), 'UTF-8');
print(key);
   



CODE
12114 INFO: PyInstaller: 3.5+498e6ee058
12114 INFO: Python: 3.10.7
12129 INFO: Platform: Linux-5.18.0-kali7-amd64-x86_64-with-glibc2.34
12130 INFO: wrote /home/hstlr/Desktop/zaslavcho/test(1).spec
12438 INFO: UPX is available.
12528 INFO: Extending PYTHONPATH with paths
['/home/hstlr/Desktop/zaslavcho', '/home/hstlr/Desktop/zaslavcho']
12528 INFO: checking Analysis
12528 INFO: Building Analysis because Analysis-00.toc is non existent
12529 INFO: Initializing module dependency graph...
12621 INFO: Initializing module graph hooks...
12632 INFO: Analyzing base_library.zip ...
23700 INFO: Processing pre-find module path hook   distutils
Traceback (most recent call last):
 File "/usr/bin/pyinstaller", line 11, in <module>
   load_entry_point('PyInstaller==3.5+498e6ee058', 'console_scripts', 'pyinstaller')()
 File "/usr/lib/python3/dist-packages/PyInstaller/__main__.py", line 111, in run
   run_build(pyi_config, spec_file, **vars(args))
 File "/usr/lib/python3/dist-packages/PyInstaller/__main__.py", line 63, in run_build
   PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 844, in main
   build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 791, in build
   exec(code, spec_namespace)
 File "/home/hstlr/Desktop/zaslavcho/test(1).spec", line 6, in <module>
   a = Analysis(['test(1).py'],
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 243, in __init__
   self.__postinit__()
 File "/usr/lib/python3/dist-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__
   self.assemble()
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 348, in assemble
   self.graph = initialize_modgraph(
 File "/usr/lib/python3/dist-packages/PyInstaller/depend/analysis.py", line 613, in initialize_modgraph
   graph.import_hook(m)
 File "/usr/lib/python3/dist-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 1473, in import_hook
   target_package, target_module_partname = self._find_head_package(
 File "/usr/lib/python3/dist-packages/PyInstaller/lib/modulegraph/modulegraph.py", line 1657, in _find_head_package
   raise ImportError("No module named " + target_package_name)
ImportError: No module named _bootlocale


--------------------
is anarchy the key to peace?
faith is the only thing that keeps you in between your changing moods.
PMEmail Poster
Top
ici
Публикувано на: 30-10-2022, 18:41
Quote Post


Group Icon
Име: Ивайло Илчев
Група: VIP
Ранг: Почетен член

Мнения: 17966
Регистриран на: 06.06.04



pip install --upgrade pyinstaller


--------------------
Ние не сме в една лодка, ние сме в една буря. Лодките са различни.

Следващият път когато се почувстваш ненужен, грозен и недооценен, помни че освен това си и тъп.
PMEmail PosterUsers Website
Top
WorldUPP
Публикувано на: 30-10-2022, 18:52
Quote Post



Име:
Група: Потребител
Ранг: Новопостъпил

Мнения: 17
Регистриран на: 28.10.22



QUOTE (ici @ 30-10-2022, 18:41)
pip install --upgrade pyinstaller

Благодаря ти, ici.
Не бях up-to-date, но явно не това е проблемът.
Опитах така:
CODE
pyinstaller --onefile --exclude_module _bootlocale test(1).py

,но стигнах до друг път без изход :
CODE
Traceback (most recent call last):
 File "/usr/bin/pyinstaller", line 11, in <module>
   load_entry_point('PyInstaller==3.5+498e6ee058', 'console_scripts', 'pyinstaller')()
 File "/usr/lib/python3/dist-packages/PyInstaller/__main__.py", line 111, in run
   run_build(pyi_config, spec_file, **vars(args))
 File "/usr/lib/python3/dist-packages/PyInstaller/__main__.py", line 63, in run_build
   PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 844, in main
   build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 791, in build
   exec(code, spec_namespace)
 File "/home/hstlr/Desktop/zaslavcho/test(1).spec", line 6, in <module>
   a = Analysis(['test(1).py'],
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 243, in __init__
   self.__postinit__()
 File "/usr/lib/python3/dist-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__
   self.assemble()
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 575, in assemble
   self._check_python_library(self.binaries)
 File "/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py", line 666, in _check_python_library
   python_lib = bindepend.get_python_library_path()
 File "/usr/lib/python3/dist-packages/PyInstaller/depend/bindepend.py", line 914, in get_python_library_path
   python_libname = findLibrary(name)
 File "/usr/lib/python3/dist-packages/PyInstaller/depend/bindepend.py", line 778, in findLibrary
   utils.load_ldconfig_cache()
 File "/usr/lib/python3/dist-packages/PyInstaller/depend/utils.py", line 375, in load_ldconfig_cache
   path = m.groups()[-1]
AttributeError: 'NoneType' object has no attribute 'groups'


--------------------
is anarchy the key to peace?
faith is the only thing that keeps you in between your changing moods.
PMEmail Poster
Top
WorldUPP
Публикувано на: 30-10-2022, 18:54
Quote Post



Име:
Група: Потребител
Ранг: Новопостъпил

Мнения: 17
Регистриран на: 28.10.22



FORGOT:
build & dist изскочиха v directory-то

.

Това мнение е било редактирано от WorldUPP на 30-10-2022, 18:55


--------------------
is anarchy the key to peace?
faith is the only thing that keeps you in between your changing moods.
PMEmail Poster
Top
ici
Публикувано на: 30-10-2022, 18:58
Quote Post


Group Icon
Име: Ивайло Илчев
Група: VIP
Ранг: Почетен член

Мнения: 17966
Регистриран на: 06.06.04



Pyinsraller-а ти е древен. Махни го и го качи отново.

pip3 ... за питон 3

Това мнение е било редактирано от ici на 30-10-2022, 19:00


--------------------
Ние не сме в една лодка, ние сме в една буря. Лодките са различни.

Следващият път когато се почувстваш ненужен, грозен и недооценен, помни че освен това си и тъп.
PMEmail PosterUsers Website
Top
WorldUPP
  Публикувано на: 30-10-2022, 19:00
Quote Post



Име:
Група: Потребител
Ранг: Новопостъпил

Мнения: 17
Регистриран на: 28.10.22



QUOTE (ici @ 30-10-2022, 18:58)
Pyinsraller-а ти е древен. Махни го и го качи отново.

Уважение! icon_exclaim.gif


--------------------
is anarchy the key to peace?
faith is the only thing that keeps you in between your changing moods.
PMEmail Poster
Top
1 потребители преглеждат тази тема в момента (1 гости, 0 анонимни потребители)
Потребители, преглеждащи темата в момента:

Topic Options Reply to this topicStart new topicStart Poll

 


Copyright © 2003-2019 | BG Development | All Rights Reserved
RSS 2.0