2016-09-17 97 views
0

我嘗試在Pycharm中運行pygame。編輯展示圖書館。但是,如果我運行該程序,我得到一個錯誤,它無法找到模塊:pygame。用phycharm運行pygame

我正在運行的Python 3.5

我添加了一個承受力: enter image description here

我嘗試這樣的:

enter image description here

謝謝

奧凱,我也做參見:

enter image description here

所以我再次運行程序:

看到圖像: enter image description here

確定。我使用Python:Python 3.4.4。

,但如果我這樣做:

PIP3安裝pygame的。我得到這樣的警告:

enter image description here

看到圖像: enter image description here

+0

這是一個python錯誤,不是pycharm – MatejMecka

回答

1

然後安裝pygame

pip install pygame 

或:

python -m pip install pygame 

或代碼:

import pip 
pip.main(['install', 'pygame']) 
+0

他沒有導入pygame,所以它可能只會產生一個模塊丟失的錯誤。 Pycharm甚至建議它 – MatejMecka

+0

謝謝你的評論。我編輯帖子 – SavantCode

0
  1. 您不必Pygame的模塊,甚至PyCharm建議給你。

  2. 您不會在Python IDE中運行pip。爲了做到安裝模塊與PIP你要打開命令行和直接運行

    Pip install PyGame

或者

Python -m pip install pygame 
  • 基於在你之前的一個問題上的回答:你確定你有pygame for Python 3.5嗎? 3.5的版本不會工作,併產生這個錯誤消息,因爲pyd文件不會找到python 3.5 dll。

    編輯:因爲您正在安裝python2。7使用PIP3安裝

    pip3 install pygame

  • 由於pygame中的PIP頁面很少被下載的,我建議你從到位桶avaivable here下載模塊。

  • +0

    oke,我編輯帖子。 – SavantCode

    +0

    確定忽略我的答案,直到我編輯它的第三件事 – MatejMecka

    +0

    @SavantCode閱讀我的文章 – MatejMecka