马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
我想把py脚本打包成exe于是用pip install Pyinstaller下载Pyinstaller,但在下载完成后,安装时提示我语法错误
我的环境变量是
%SystemRoot%\system32;
%SystemRoot%;
%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;
C:\Users\ADMIN\AppData\Local\Programs\Python\Python35\Scripts;
C:\Users\ADMIN\AppData\Local\Programs\Python\Python35
python版本是3.5
一调用pip函数就会提示我:Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\ADMIN>pip
Error processing line 1 of c:\users\admin\appdata\local\programs\python\python
5\lib\site-packages\distutils-precedence.pth:
Traceback (most recent call last):
File "c:\users\admin\appdata\local\programs\python\python35\lib\site.py",
ine 167, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "c:\users\admin\appdata\local\programs\python\python35\lib\site-packa
es\_distutils_hack\__init__.py", line 194
f'spec_for_{name}',
^
SyntaxError: invalid syntax
Remainder of file ignored
Traceback (most recent call last):
File "c:\users\admin\appdata\local\programs\python\python35\lib\runpy.py", l
ne 184, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\admin\appdata\local\programs\python\python35\lib\runpy.py", l
ne 85, in _run_code
exec(code, run_globals)
File "C:\Users\ADMIN\AppData\Local\Programs\Python\Python35\Scripts\pip.exe\
_main__.py", line 5, in <module>
File "c:\users\ADMIN\appdata\local\programs\python\python35\lib\site-package
\pip\_internal\cli\main.py", line 57
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
希望有缘人能帮忙解决
pip 出错的地方是 f-string 的字符串格式化方式,
你的 python 版本太低了,f-string 从 python3.6 才开始支持,你用的 python3.5
|