To install pyinputplus
, use pip, the Python package installer. Here's how:
-
Open your terminal or command prompt.
-
Use pip to install pyinputplus:
pip install pyinputplus
This command downloads and installs
pyinputplus
and its dependencies automatically. -
(macOS and Linux Specific - Python 3): If you are using Python 3 on macOS or Linux, you might need to use
pip3
instead ofpip
:pip3 install pyinputplus
-
(Permissions Error): If you encounter permission errors during installation, try installing with the
--user
option:pip install --user pyinputplus
This installs the package in your user directory, avoiding the need for administrator privileges.
Verification:
After installation, you can verify that pyinputplus
is installed correctly by opening a Python interpreter and importing it:
import pyinputplus as pyip
# Example usage (optional)
user_input = pyip.inputInt("Enter an integer: ")
print(f"You entered: {user_input}")
If the import statement doesn't raise an ImportError
, pyinputplus
is installed successfully.