How to Install Modules for Python 3.X Using Pip in Windows 10

Part 1 of 3:

Getting pip On Your System

  1. Depending on whether Python is already on your computer or not, you may have to take different steps. Use Method 1 or Method 2 depending on your circumstance.

If Python is Not Installed

  1. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 1
    Go to python.org to select the version of Python you wish to download. Typically, the latest version is preferable as it is less bug-prone and has more features, but nearly all the Python 3.X installations should work just fine. Remember to get the 32-bit or 64-bit depending on your system.
  2. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 2
    Run the installer once it's finished downloading. This is to initiate the installation process. For the most part this is self-explanatory, but there's a crucial check to make.
  3. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 3
    Check off 'Add Python 3.x to PATH'. This will allow you to use Python and pip from a command shell easily, which is important for installing packages.

If Python is Already Installed

  1. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 4
    Test to see if pip can be used from the command line already by typing pip -V into a command shell. If this command works and version details for your pip installation are shown, you can skip to Part 2 of this guide. Continue below if the command fails.
  2. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 5
    Locate the directory in which you installed Python originally. Remember this path; that's the folder where the executables are for running Python and pip. This may be difficult to find, but typical locations that you may find Python installed at are:
    1. C:PythonXX
    2. C:UsersAppDataLocalProgramsPythonPythonXX
  3. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 6
    Open the Environment Variables dialog. This can be done by searching up "system variables" and clicking on the first option, then clicking on the Environment Variables… button.
  4. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 7
    How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 8
    Add the Python path you just copied to the user 'Path' variable. You can do this by selecting the 'Path' variable, clicking Edit…New and pasting the path. Paste it again in a new field with "Scripts" at the end of it. You may need to restart your computer after this step.
    1. After following these steps, you will have a local Python installation with full pip functionality that you can use from a command shell.
Part 2 of 3:

Finding and Installing Modules for Python

  1. For this example, the module installed will be numpy — an extremely rich mathematical library with robust functionality that many other libraries depend on. You can install whatever you'd like however.
  1. Research what kind of modules you want to install on your computer. There are many, many modules out there that all do great things. In order to deal with the problems you want your program to solve, try looking up modules online by searching "how to python"; more often than not, websites can be full of recommendations and helpful advice.
  2. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 9
    Look up the package name for the module you want to install. Go to pypi.org and look up the module you want. The name of the package that contains it as well as the command needed to install it are at the top of the page. It will look something like pip install .
  3. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 10
    Open the command shell on your computer and run the command from the PyPI page. This will initiate the installation process. Remember to close all instances of Python that are running when you do this.

After completing this part, the module will be installed and ready for use in your Python projects.

Part 3 of 3:

Using Newly Installed Modules in Python Code

  1. After getting your hands on a new Python module, the next step may seem obvious — use the module! — but it may be likely that you might not know exactly how the module is imported, initiated or otherwise. Here are some steps to help you get started.
  1. How to Install Modules for Python 3.X Using Pip in Windows 10 Picture 11
    Open a fresh Python instance (IDLE or shell) and type in the import statement for your module. More often than not, the module name for importing is the same as the package name. You can always use the documentation to verify this. Once you type in the line of code to set up your import, you're good to go. Add some other code as you need to.
  2. Execute your code in your editing environment. If no errors occur, congratulations! You've managed to install a brand-new third-party Python module.
    1. With this, your foray into Python module installation and usage is complete!
4 ★ | 2 Vote

May be interested

  • More than 100 Python exercises have solutions (sample code)More than 100 Python exercises have solutions (sample code)
    more than 100 python code examples are shared by guy zhiwehu on github, however, the solution of this series is written on the old python version. following tipsmake.com will be vietnameseized and edited to suit python 3.x to help you learn and practice python.
  • How to Write a Basic Python ProgramHow to Write a Basic Python Program
    python is a high-level programming language. the language utilizes a straightforward syntax which can make it easy for new users to get started. ==== install the dependencies ====
  • Learn the Windows Modules Installer Worker processLearn the Windows Modules Installer Worker process
    when you start your computer, if you see the computer fan becomes hot without any reason, check task manager and you will see 'windows modules installer worker' using a lot of cpu and disk resources. this process, also known as tiwoker.exe, is part of the windows operating system.
  • Bookmark 5 best Python programming learning websitesBookmark 5 best Python programming learning websites
    if you are a developer or you are studying and want to stick with this industry, learn python to add a highlight in your journey.
  • How to Install Python Packages on Windows 7How to Install Python Packages on Windows 7
    you want to use python on a windows 7 machine but you don't know what you're doing. what you do know is that in order to go anywhere and do anything you've got to install packages. or maybe you don't even know that yet. take a look at the...
  • For in Python loopFor in Python loop
    in this article, we will learn more about for for loop in python as well as its variations, how to use for to repeat a string of elements in python such as list, string or other iterative objects.
  • Manage files and folders in PythonManage files and folders in Python
    python also provides a variety of methods to handle various directory-related operations. in this article, we will learn about managing files and directories in python, namely creating folders, renaming folders, listing folders and working with them.
  • How to install Python plugin to be able to execute Python programming on IntelliJHow to install Python plugin to be able to execute Python programming on IntelliJ
    is it possible to program python on intellij idea? instructions on setting up, installing python plugin to be able to program python on intellij ...
  • Multiple choice quiz about Python - Part 3Multiple choice quiz about Python - Part 3
    today's topic quantrimang wants to challenge you is about file and exception handling in python. let's try the following 15 questions!
  • 5 choose the best Python IDE for you5 choose the best Python IDE for you
    in order to learn well python, it is essential that you find yourself an appropriate ide to develop. quantrimang would like to introduce some of the best environments to help improve your productivity.