为什么pip出现语法错误
我想把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 本帖最后由 临时号 于 2022-7-8 18:42 编辑
看一下这两篇文章:
https://blog.csdn.net/weixin_44023791/article/details/115858847
https://blog.csdn.net/Yingccu/article/details/119609655
或者升级你的python版本 临时号 发表于 2022-7-8 18:38
看一下这两篇文章:
https://blog.csdn.net/weixin_44023791/article/details/115858847
https://blog.csd ...
谢谢你,但只能设置一个最佳答案{:10_254:}
页:
[1]