当我试图安装pyinstaller时,我无法运行命令

2024-06-01 02:44:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着安装和运行它,但我这样做,它不起作用。在

C:\Users\Dino Non Admin>py -m pip install pyinstaller
Collecting pyinstaller
  Using cached PyInstaller-3.3.tar.gz
Requirement already satisfied: setuptools in c:\users\dino non admin\appdata\local\programs\python\python35\lib\site-packages (from pyinstaller)
Requirement already satisfied: pefile>=2017.8.1 in c:\users\dino non admin\appdata\local\programs\python\python35\lib\site-packages (from pyinstaller)
Requirement already satisfied: macholib>=1.8 in c:\users\dino non admin\appdata\local\programs\python\python35\lib\site-packages (from pyinstaller)
Requirement already satisfied: future in c:\users\dino non admin\appdata\local\programs\python\python35\lib\site-packages (from pyinstaller)
Requirement already satisfied: pypiwin32 in c:\users\dino non admin\appdata\local\programs\python\python35\lib\site-packages (from pyinstaller)
Requirement already satisfied: altgraph>=0.13 in c:\users\dino non admin\appdata\local\programs\python\python35\lib\site-packages (from macholib>=1.8->pyinstaller)
Installing collected packages: pyinstaller
  Running setup.py install for pyinstaller ... done
Successfully installed pyinstaller-3.3

C:\Users\Dino Non Admin>pyinstaller
'pyinstaller' is not recognized as an internal or external command,
operable program or batch file.

另外,对于这些文件:

^{pr2}$

当我打开它们时,它会这样做:

Pyinstaller cannot check for assembly dependencies.
Please install PyWin32 or PyWin32-ctypes

我试着照上面说的做,但是

C:\Users\Dino Non Admin>py -m pip install pypiwin32
Requirement already satisfied: pypiwin32 in c:\users\dino non admin\appdata\local\programs\python\python35\lib\site-packages

Tags: inadminlibpackageslocalrequirementusersappdata
2条回答

PyInstaller是一个应用程序而不是一个包。你不用在电脑里安装就可以使用它。只需下载并提取它。在

cd pyinstaller

您想要的包是newscript.py。我把它保存在pyinstaller文件夹中。现在为了创建这个脚本的可执行文件,只需运行

^{pr2}$

它将处理脚本并创建一个名为newscript的文件夹。的Pyinstaller将生成文件夹用作临时容器,以包含所需的包和文件。dist文件夹将包含可执行文件。在

尝试pip install pywin32-ctypes。在

相关问题 更多 >