web-dev-qa-db-ja.com

Python 3.6.0のPygameインストール

私はPygame 1.9.2でPython 3.5.2を使用していて、すべてが正常に機能していました。その後、最近リリースされたPython 3.6.0フレッシュインストールですが、これでPygameを再インストールしようとしたとき:

pip install pygame

それは以下を返しました:

Collecting pygame
  Downloading pygame-1.9.2.tar.gz (3.0MB)
    100% |████████████████████████████████| 3.0MB 292kB/s
    Complete output from command python setup.py Egg_info:


    WARNING, No "Setup" File Exists, Running "config.py"
    Using WINDOWS configuration...

    Path for SDL not found.
    Too bad that is a requirement! Hand-fix the "Setup"
    Path for FONT not found.
    Path for IMAGE not found.
    Path for MIXER not found.
    Path for PNG not found.
    Path for JPEG not found.
    Path for PORTMIDI not found.
    Path for COPYLIB_tiff not found.
    Path for COPYLIB_z not found.
    Path for COPYLIB_vorbis not found.
    Path for COPYLIB_ogg not found.

    If you get compiler errors during install, doublecheck
    the compiler flags in the "Setup" file.


    Continuing With "setup.py"
    Error with the "Setup" file,
    perhaps make a clean copy from "Setup.in".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\rodri\AppData\Local\Temp\pip-build-328x7lme\pygame\setup.py", line 165, in <module>
        extensions = read_setup_file('Setup')
      File "c:\python\lib\distutils\extension.py", line 171, in read_setup_file
        line = expand_makefile_vars(line, vars)
      File "c:\python\lib\distutils\sysconfig.py", line 410, in expand_makefile_vars
        s = s[0:beg] + vars.get(m.group(1)) + s[end:]
    TypeError: must be str, not NoneType

    ----------------------------------------
Command "python setup.py Egg_info" failed with error code 1 in C:\Users\rodri\AppData\Local\Temp\pip-build-328x7lme\pygame\
3

私は次のコマンドを使用してこれを解決しました:

pip install wheel

そしてダウンロードpygame‑1.9.2‑cp36‑cp36m‑win_AMD64.whl from here (64ビットWindowsを使用しています)。ファイルをPythonフォルダにコピーしてから使用しました

pip install pygame‑1.9.2‑cp36‑cp36m‑win_AMD64.whl

そしてそれは働いた。

7

最近、学校の一連のWindowsマシンにPyGameとPyQt5をインストールしました。既存の(2.4)Pythonをアンインストールしました。次に、Python 3.orgのインストーラーを3.6.1に使用しました。ボックスをチェックしてPython=をPATHに入れ、カスタムインストールを使用してすべてのユーザーにインストールしました。これで問題なく動作しました。

次に、pygameとPyQt5をインストールするには、Windowsのコマンドプロンプト(管理者として)を開き、「pip3 install pygame」、次に「pip3 install pyqt5」を実行しました。

どちらも問題なく動作し、インストール全体がうまく動作しました。

0
Tim