Open In App

Installing Python telnetlib module

Last Updated : 26 Jan, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we are going to see how to install the telnetlib library in Python. 

The telnetlib module provides a Telnet class that implements the Telnet protocol.  If you have Python installed, the telnetlib library is already installed, but if it isn’t, we can use the pip command to install it.

You can install it by running the following into your command prompt:

pip install telnetlib3

The output will look like this after a successful installation:

To test if it’s installed or not, try importing it into a Python program and running it; if no errors occur, we can conclude that it’s installed and working. You can use this command to import it –

import telnetlib

Alternatively, you can use the code below to see if it’s installed on your system:

Python




# we will be using try and except block
# to identify it is able
# to import it or not
  
try:
    import telnetlib
    print("working")
except:
    print("not working")


Output:

Working

The word “working” appears in the result, indicating that the import was successful.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads