小学生python编程遇到小问题

今天换电脑整理一篇小学生学习python游戏开发,结果新电脑上的python环境出现如下错误

>pip install pgzero
Traceback (most recent call last):
  Filee:odsoftpythonlibrunpy.py“, line 193, in _run_module_as_main
    “__main__“, mod_spec)
  Filee:odsoftpythonlibrunpy.py“, line 85, in _run_code
    exec(code, run_globals)
  File “E:odsoftpythonScriptspip.exe__main__.py“, line 5, in <module&gt;
ModuleNotFoundError: No module named ‘pip
网上查了下,用如下命令顺利解决

1、python -m ensurepip

(venv) F:乐乐python&gt;python -m ensurepip
Looking in links: C:UsersAdministratorAppDataLocalTemptmpl2m030qv
Requirement already satisfied: setuptools in e:odsoftpythonlibsitepackages (40.8.0)
Collecting pip
Installing collected packages: pip
Successfully installed pip-19.0.3

2、python -m pip installupgrade pip

venv) F:乐乐python>python -m pip install –upgrade pip
Looking in indexes: https://pypi.doubanio.com/simple
Collecting pip
  Using cached https://pypi.doubanio.com/packages/1f/2c/d9626f045e7b49a6225c6b09257861f24da78f4e5f23a
f2ddbdf852c99b8/pip-22.2.2-py3-noneany.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-22.2.2
安装成功

(venv) F:乐乐python>pip install pgzero
WARNING: Ignoring invalid distribution -ip (e:odsoftpythonlibsitepackages)
WARNING: Ignoring invalid distribution -ip (e:odsoftpythonlibsitepackages)
Looking in indexes: https://pypi.doubanio.com/simple
Collecting pgzero
  Downloading https://pypi.doubanio.com/packages/2c/66/bc46c203802d47fa30a6caa92d13392274bcbebbb9ffcd
0c5ed8030b3611/pgzero-1.2.1-py3-noneany.whl (71 kB)
     —————————————- 71.3/71.3 kB 1.3 MB/s eta 0:00:00
Requirement already satisfied: numpy in e:odsoftpythonlibsite-packages (from pgzero) (1.20.2)
Collecting pygame~=2.0
  Downloading https://pypi.doubanio.com/packages/cc/18/2c7ba52b97d773c9fc6d40c8733432b243cee9b9bc6394
04dfa8fe391217/pygame-2.1.2-cp37-cp37m-win32.whl (8.1 MB)
     —————————————- 8.1/8.1 MB 8.6 MB/s eta 0:00:00
WARNING: Ignoring invalid distribution -ip (e:odsoftpythonlibsite-packages)
Installing collected packages: pygame, pgzero
WARNING: Ignoring invalid distribution -ip (e:odsoftpythonlibsite-packages)
WARNING: Ignoring invalid distribution -ip (e:odsoftpythonlibsite-packages)
Successfully installed pgzero-1.2.1 pygame-2.1.2
WARNING: Ignoring invalid distribution -ip (e:odsoftpythonlibsite-packages)
WARNING: Ignoring invalid distribution -ip (e:odsoftpythonlibsite-packages)
WARNING: Ignoring invalid distribution -ip (e:odsoftpythonlibsite-packages)

原文地址:https://blog.csdn.net/fqfq123456/article/details/127165649

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_22932.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注