pip命令安装 pyinstaller失败解决办法
写在前面,如果是用win10系统的用户,一定要先通过管理员模式打开命令窗口,我是直接按 win + x 键,选择 "Windows Powershell(管理员)",否则会提示: [Errno 13] Permission denied:
下面是在管理员模式下通过 pip 命令安装失败
从下面错误来看,是安装build的依赖失败,但具体是哪些也不清楚,网上找也没有类似错误的解决办法,大都都是下载setup.py文件来安装
1 Windows PowerShell 2 版权所有 (C) Microsoft Corporation。保留所有权利。 3 4 PS C:\Windows\system32> pip install PyInstaller 5 Collecting PyInstaller 6 Downloading https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz (3.5MB) 7 100% |████████████████████████████████| 3.5MB 44kB/s 8 Installing build dependencies ... error 9 Complete output from command "c:\program files\python3\python.exe" "c:\program files\python3\lib\site-packages\pip" install --ignore-installed --no-user --prefix C:\Users\S~1.WU\AppData\Local\Temp\pip-build-env-0g2rl8se\overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel: 10 Traceback (most recent call last): 11 File "c:\program files\python3\lib\runpy.py", line 193, in _run_module_as_main 12 "__main__", mod_spec) 13 File "c:\program files\python3\lib\runpy.py", line 85, in _run_code 14 exec(code, run_globals) 15 File "c:\program files\python3\lib\site-packages\pip\__main__.py", line 16, in <module> 16 from pip._internal import main as _main # isort:skip # noqa 17 File "c:\program files\python3\lib\site-packages\pip\_internal\__init__.py", line 40, in <module> 18 from pip._internal.cli.autocompletion import autocomplete 19 File "c:\program files\python3\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in <module> 20 from pip._internal.cli.main_parser import create_main_parser 21 File "c:\program files\python3\lib\site-packages\pip\_internal\cli\main_parser.py", line 12, in <module> 22 from pip._internal.commands import ( 23 File "c:\program files\python3\lib\site-packages\pip\_internal\commands\__init__.py", line 6, in <module> 24 from pip._internal.commands.completion import CompletionCommand 25 File "c:\program files\python3\lib\site-packages\pip\_internal\commands\completion.py", line 6, in <module> 26 from pip._internal.cli.base_command import Command 27 File "c:\program files\python3\lib\site-packages\pip\_internal\cli\base_command.py", line 25, in <module> 28 from pip._internal.index import PackageFinder 29 File "c:\program files\python3\lib\site-packages\pip\_internal\index.py", line 41, in <module> 30 from pip._internal.wheel import Wheel 31 File "c:\program files\python3\lib\site-packages\pip\_internal\wheel.py", line 7, in <module> 32 import compileall 33 File "c:\program files\python3\lib\compileall.py", line 20, in <module> 34 from concurrent.futures import ProcessPoolExecutor 35 File "c:\program files\python3\lib\site-packages\concurrent\futures\__init__.py", line 8, in <module> 36 from concurrent.futures._base import (FIRST_COMPLETED, 37 File "c:\program files\python3\lib\site-packages\concurrent\futures\_base.py", line 381 38 raise exception_type, self._exception, self._traceback 39 ^ 40 SyntaxError: invalid syntax 41 42 ---------------------------------------- 43 Command ""c:\program files\python3\python.exe" "c:\program files\python3\lib\site-packages\pip" install --ignore-installed --no-user --prefix C:\Users\S~1.WU\AppData\Local\Temp\pip-build-env-0g2rl8se\overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel" failed with error code 1 in None
下面就介绍用setup.py文件进行安装
1、先下载 pyinstaller的安装文件,下载地址:http://www.pyinstaller.org/downloads.html
2、我安装的是3.4版本,直接下载:pyinstaller 3.4
3、下载到本地后,直接解压,然后通过管理员模式打开命令窗口,用 cd 命令切换至 pyinstaller的解压路径,然后运行 python setup.py install
4、安装的过程会花点时间,就耐心等待吧,出现下面的提示表明安装成功
1 2 3 4 5 6 7 8 9 | Best match: setuptools 40.8 . 0 Adding setuptools 40.8 . 0 to easy - install.pth file Installing easy_install - script.py script to C:\Program Files\Python3\Scripts Installing easy_install.exe script to C:\Program Files\Python3\Scripts Installing easy_install - 3.6 - script.py script to C:\Program Files\Python3\Scripts Installing easy_install - 3.6 .exe script to C:\Program Files\Python3\Scripts Using c:\program files\python3\lib\site - packages Finished processing dependencies for PyInstaller = = 3.4 |
5、通过 pip show pyinstaller查看详细信息进一步确认安装情况
1 2 3 4 5 6 7 8 9 10 11 | PS C:\Windows\system32> pip show pyinstaller Name: pyinstaller Version: 3.4 Summary: PyInstaller bundles a Python application and all its dependencies into a single package. Home - page: http: / / www.pyinstaller.org Author: Giovanni Bajo, Hartmut Goebel, David Vierra, David Cortesi, Martin Zibricky Author - email: pyinstaller@googlegroups.com License: GPL license with a special exception which allows to use PyInstaller to build and distribute non - free programs (including commercial ones) Location: c:\program files\python3\lib\site - packages\pyinstaller - 3.4 - py3. 6.egg Requires: setuptools, pefile, macholib, altgraph, pywin32 - ctypes Required - by: |
标签:
Pyinstaller
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?