问题
I'm very new to both Python and Pygame. I have Python 3.5.1 32-bits installed on Window and Pygame 1.9.2 Python 3.5 installed as well. But in case if i forget, is there a way to check the pygame version I have installed from either command line or Python IDLE.
For Python, I use python -V
But for Pygame, I don't know how to.
Sorry in advance if my question is silly.
回答1:
Use this: pip show <pack_name>
Alternative:
pip freeze | grep <pack_name>
回答2:
I know this question is a year old and has an accepted answer but I've stumbled upon another way to check the version while researching. You basically import pygame from the command line and type this code
pygame.version.ver
or
pygame.version.vernum
The first one returns the version as a string and the second one returns it as a tuple of integers.
I found this from here and I know this might be unnecessairy but I wanted to include it anyway.
回答3:
pip show pygame // command to check your pygame details
output:
Name: pygame
Version: 1.9.4
Summary: Python Game Development
Home-page: https://www.pygame.org
Author: Pete Shinners, Rene Dudfield, Marcus von Appen, Bob Pendleton, others...
Author-email: pygame@seul.org
License: LGPL
Location: /home/linux/anaconda3/lib/python3.6/site-packages
Requires:
Required-by:
来源:https://stackoverflow.com/questions/37536936/checking-pygame-version