Forums

cannot pip install pygame in console

when i did pip install pygame in console,

got this error:

$ pip install pygame DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2 .7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Looking in links: /usr/share/pip-wheels Collecting pygame Downloading https://files.pythonhosted.org/packages/d2/11/4212b97ea025aca55e2284e9c7d8cb87cfaddb4e89f5eb613c81017246c1/pygame-2.0.1-cp27-cp27mu-manylinux1_x86_64.whl (11.7MB) |████████████████████████████████| 11.7MB 36.1MB/s Installing collected packages: pygame ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pygame' Consider using the --user option or check the permissions.

how do i fix this error ?? please help !!

thanks

To fix the error you see, you need to follow the instruction given in the error message: "Consider using the --user option". Another issue would be the usage of the pygame package itself, which requires a GUI environment, hence it wouldn't work on PythonAnywhere anyway, see: https://www.pythonanywhere.com/forums/topic/358/.