如何将pygame库导入Eclipse的pydev? [英] How do you import pygame libraries into Eclipse's pydev?

查看:219
本文介绍了如何将pygame库导入Eclipse的pydev?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse,并且正在使用Pydev插件,并且在pygame方面需要一些帮助.我在Mac上,已经设法使用自制软件让pygame适用于python 3.3,而pydev却给我带来了一些麻烦.这些库似乎未被认可.我可以根据需要使用pygame,进行

I have Eclipse working and am working uder the Pydev plugin, and I need some help with pygame. I'm on a mac and have managed to get pygame working for python 3.3 using homebrew, and pydev's causing me some trouble. The libraries don't seem to be recognized. I can use pygame as needed, doing things like

import pygame

pygame.init()

没有问题,但是Eclipse无法识别模块并显示类似内容

without problem, but Eclipse doesn't recognize the modules and says things like

unresolved import: pygame

同样,我认为这里的问题是Eclipse无法访问pygame库.我该如何解决?

Again, I think the issue here is Eclipse not having access to the pygame libraries. How do I fix this?

推荐答案

Windows>首选项> pydev

Windows > Preferences > pydev

寻找python解释器行

look for the python interpreter line

在库"标签上,单击新文件夹并添加pygame文件夹路径,应用即可完成

on the libraries tab, click new folder and add the pygame folder path, apply and you're done

注意:确保使用python 3.x作为项目解释器

NOTE : make sure to use python 3.x as the project interpreter

这篇关于如何将pygame库导入Eclipse的pydev?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆