I've tried lots of different ways of installing pygame and none work it always comes up with an error message.
I need this module for a game: I'm trying to make a multiplayer game for a project for school and online told me to use this module.
Any help would be great!! Also I've never put a question on here before so hope I'm doing it right! Thanks
C:\Users\RDSTw>py -m pip install pygame==2.0.0.dev6
Collecting pygame==2.0.0.dev6
Using cached pygame-2.0.0.dev6.tar.gz (3.7 MB)
ERROR: Command errored out with exit status 1:
command: 'C:\Python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\RDSTw\\AppData\\Local\\Temp\\pip-install-lgh1zxp0\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\RDSTw\\AppData\\Local\\Temp\\pip-install-lgh1zxp0\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\RDSTw\AppData\Local\Temp\pip-pip-egg-info-ov5fgttm'
cwd: C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\
Complete output (31 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\setup.py", line 258, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\config.py", line 208, in main
deps = CFG.main(**kwds)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\config_win.py", line 559, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\download_win_prebuilt.py", line 269, in ask
update(x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\download_win_prebuilt.py", line 252, in update
download_prebuilts(download_dir, x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\download_win_prebuilt.py", line 101, in download_prebuilts
download_sha1_unzip(url, checksum, temp_dir, 1)
File "C:\Users\RDSTw\AppData\Local\Temp\pip-install-lgh1zxp0\pygame\buildconfig\download_win_prebuilt.py", line 17, in download_sha1_unzip
import requests
ModuleNotFoundError: No module named 'requests'
Making dir :prebuilt_downloads:
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
This says that you don't have the requests module installed. So first install requests using pip install -U requests and then again install pygame. I also did it this way.
Related
This question already has answers here:
Can't install new packages for Python (Python 3.9.0, Windows 10)
(6 answers)
Unable to install pygame on Python via pip (Windows 10)
(6 answers)
Closed 2 years ago.
So I coded a game in python with pygame in pycharm. I installed pygame via pycharm, when I coded, but now as I am done coding, I want to simply open the .py file, but get an error that pygame isnt found. so I tried to install pygame with pip. Sadly I allways get following error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\mattis\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Mattis\\AppData\\Local\\Temp\\pip-install-56l68d_r\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\Mattis\\AppData\\Local\\Temp\\pip-install-56l68d_r\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Mattis\AppData\Local\Temp\pip-pip-egg-info-bsw9xn7u'
cwd: C:\Users\Mattis\AppData\Local\Temp\pip-install-56l68d_r\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Mattis\AppData\Local\Temp\pip-install-56l68d_r\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\Mattis\AppData\Local\Temp\pip-install-56l68d_r\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\Mattis\AppData\Local\Temp\pip-install-56l68d_r\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\Mattis\AppData\Local\Temp\pip-install-56l68d_r\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I updated the setuptools and did some other stuff none of this worked. I then completely uninstalled Python and pip, reinstalled it, but I still get the same error message. Does somebody have an idea what is going wrong during the installation?
This is the error I get when I try to download pygame.
ERROR: Command errored out with exit status 1:
command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-hkauem4n\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-hkauem4n\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\pip-pip-egg-info-k1_a0_dp'
cwd: C:\Users\user\AppData\Local\Temp\pip-install-hkauem4n\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\user\AppData\Local\Temp\pip-install-hkauem4n\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\user\AppData\Local\Temp\pip-install-hkauem4n\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\user\AppData\Local\Temp\pip-install-hkauem4n\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\user\AppData\Local\Temp\pip-install-hkauem4n\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Can't find an answer anywhere to this problem, can someone help me, please?
I was having the same issue a while ago. You have to download visual studio c++ build tools to download pygame.
https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
Go there and scroll down until you see Build Tools for Visual Studio 2019 and download that. Then run "pip install pygame" and it should work.
This question already has answers here:
Unable to install pygame on Python via pip (Windows 10)
(6 answers)
Closed 2 years ago.
Collecting pygame
Using cached pygame-1.9.6.tar.gz (3.2 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\dell\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-y044p4mq\pygame\setup.py'"'"'; file='"'"'C:\Users\DELL\AppData\Local\Temp\pip-install-y044p4mq\pygame\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\DELL\AppData\Local\Temp\pip-pip-egg-info-m8a9tj8v'
cwd: C:\Users\DELL\AppData\Local\Temp\pip-install-y044p4mq\pygame
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\DELL\AppData\Local\Temp\pip-install-y044p4mq\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\DELL\AppData\Local\Temp\pip-install-y044p4mq\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\DELL\AppData\Local\Temp\pip-install-y044p4mq\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\DELL\AppData\Local\Temp\pip-install-y044p4mq\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
To install pygame:
On Windows: pip install pygame==2.0.0.dev14
On Mac OS and Linux: pip3 install pygame==2.0.0.dev14
I am trying to install django-visits, but anytime I run the "pip install django-visits" command, I get the following error:
ERROR: Command errored out with exit status 1:
command: 'c:\users\samuel\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-insta
ll-8t2j3cs9\\distribute\\setup.py'"'"'; __file__='"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-install-8t2j3cs9\\distribute\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__fi
le__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3c
s9\distribute\pip-egg-info'
cwd: C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\
Complete output (15 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\dist.py", line 7, in <module>
from setuptools.command.install import install
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\command\__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\setuptools\command\install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "C:\Users\Samuel\AppData\Local\Temp\pip-install-8t2j3cs9\distribute\pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```
How can I fix it?
Simply try pip3 install django-visits and see if it works. If not, follow the solution below.
I think this is because python3.7 and pip were installed from different sources.
I suggest using python's inbuilt facility to install pip i.e
python3 -m ensurepip --upgrade
This should install pip3 and pip3.x where x in python3.x.
This question already has answers here:
Unable to install pygame on Python via pip (Windows 10)
(6 answers)
Error in installing Matplotlib : fatal error C1083
(4 answers)
Closed 3 years ago.
I am trying to install pygame in python 3.8, but I am having an error message I can't figure out what's wrong.
I am following a tutorial that used the command pip install pygame within the script folder after installing python, but that doesn't seem to work for me.
Any idea of what I am doing wrong or what I need to do? I am not very good with the systems around python.
C:\Users\KaspArno\AppData\Local\Programs\Python\Python38-32\Scripts>pip install pygame
Collecting pygame
Using cached https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\kasparno\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\KaspArno\\AppData\\Local\\Temp\\pip-install-hntok19u\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\KaspArno\\AppData\\Local\\Temp\\pip-install-hntok19u\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\pip-egg-info'
cwd: C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The issue is more likely with python 3.8, you need to compile it yourself or use an older version of python (<= 3.7).