How to install packages? | Sololearn: Learn to code for FREE!


How to install packages?

I want to install packages onto Python eg pygame but I'm not sure how. I've already tried pip but when I tried to use pip it wouldn't work. can someone help please?

2/15/2017 6:31:56 PM

Cameron Green

4 Answers

New Answer


Man, download the great Czech software PyCharm and forget about problems with installing modules. Really works like a... (py)charm! ;)


Another 'module' instalation tool like 'pip' is 'easy_install': you could try it... If you are on Linux Debian based, some modules are instalable by aptitude tools: try a research with them... ( on Ubuntu based Linux, you may find some in their deposit system ).


I usually make a virtual environment of my python install for each project or set of projects so as not to mess with my main installation of python on my machine. Then install packages into that new virtual environment (venv) using pip. create a venv and then make it active for the terminal. $ pip install virtualenv $ cd my_project_folder $ virtualenv venv $ source venv/bin/activate More info on venvs More info on using pip. You may need to install or update setuptools. $ pip install -U setuptools You may need to update your version of pip. $ pip install --upgrade pip Using pip to install pygame. $ pip install pygame Note that any of the above instructions may change slightly depending on what Operating System you're on and your user privileges. You may need to use the sudo command as well.


As @ChaoticDawg suggested, "you may need to use the sudo command as well": if you are unde linux system, module often required running under super user rights to be able to write on some files / folder ( directories ) ^^