所以我一直在遵循一些关于如何从这里的链接安装Pygame的说明:
最后三个命令如下所示
$
# Use mercurial to clone current code
hg clone https://bitbucket.org/pygame/pygame
# Build and install
cd pygame
sudo python3 setup.py
$
当我运行最后一个命令来运行安装文件时,在它正常运行之前,我得到了这个错误。
building 'pygame.imageext' extension
creating build/temp.linux-x86_64-
我进入IDLE并在shell中输入import pygame,它会给我一个错误。然后我进入一个新的程序,输入import pygame,我得到了同样的错误。我用pip安装了pygame,使用的是python3,3.6.8版本。
我已经尝试重新安装pygame,并尝试使用sudo安装。我也尝试过使用pip3,同样的结果。
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>>
当尝试在anaconda 3 (python 3) linux中安装pygame时,我遇到了
conda install -c CogSci pygame=1.9.2a0
解算环境:失败
UnsatisfiableError: The following specifications were found to be in conflict:
- pygame=1.9.2a0
- singledispatch
Use "conda info <package>" to see the dependencies for each package.
我应该用这个
我正在尝试在pycharm上导入pygame,我已经安装了pygame,当我通过命令行执行程序时,它会运行,但当我试图从pycharm使用它时,它不起作用。我试图将其添加到项目解释器中,但出现错误:
Non-zero exit code (1) Collecting Pygame No matching distribution found for Pygame the requirement Pygame (from versions: )
我也尝试过从命令行执行pip install Pygame,但出现了:Collecting Pygame Could not find a versio
使用pygame模块作为跨平台可执行文件打包python脚本的最佳方式是什么?我需要能够在我的Linux机器上编译。我试过使用PyInstaller,但是,当我运行编译后的可执行文件时,它显示找不到pygame模块。当我将它作为python脚本通过Wing IDE debug运行时,它工作得很好,所以我显然已经安装了pygame。但是,当我尝试在没有IDE调试的情况下运行时,它无法创建窗口。我的脚本是不是出了什么问题,只能通过Wing IDE运行?我如何打包我的游戏,让它在任何计算机上运行,Linux或Windows,甚至不需要python或pygame?这有可能吗?
我的资料来源:
这是一个初级的问题。我在Ubuntu10.10上教自己玩游戏。我下载了几个例子,电子游戏不起作用。我怀疑是安装问题。但我不知道怎么弄清楚。
我还需要安装什么东西才能完成这个任务吗?
我的例子:
我的错误:
prompt: python pyplotter.py
pyplotter.py:27: RuntimeWarning: use font: No module named font
(ImportError: No module named font) font = pygame.font.SysFont("arial",12)
Traceback (mos
我找不到pygame.init()函数。请看看我做了什么。 ckim@chan-ubuntu:~$ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
pygame 1.9.4
Hello from the pygam
abhigenie92@ubuntu:~/Desktop/pygame-1.9.1release$ which python
/home/abhigenie92/anaconda/bin/python
abhigenie92@ubuntu:~/Desktop/pygame-1.9.1release$ sudo apt-get install python-pygame
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pygame is a
我正在尝试安装pgext以便与pygame一起使用,但是当运行python setup.py安装时,我得到以下错误
Include path not found (SDL)
SDL: /usr/lib/arm_linux-gnueabihf
Traceback (most recent call last):
File "setup.py", line 198, in <module>
cfgsetup.configure()
File "setup.py", line 167, in configure
incdirs.append
我对pygame完全是个新手。在安装它并查看教程后,我运行的第一个代码块(来自教程)将我带到pygame模块,并指出找不到pygame.base。它根本找不到其中的任何一个:
from pygame.base import *
from pygame.constants import *
from pygame.version import *
from pygame.rect import Rect
from pygame.compat import geterror
import pygame.rwobject
import pygame.surflock
import pygame.co
我对linux比较陌生,正在尝试为python安装pygame dev环境。当我运行setup.py时,它告诉我需要安装以下依赖项,其中一个是我找到并安装的(SDL)。然而,其他的则更加难以捉摸。
Hunting dependencies...
sh: smpeg-config: command not found
WARNING: "smpeg-config" failed!
SDL : found 1.2.14
FONT : not found
IMAGE : not found
MIXER : not found
SMPEG : not foun