2015-08-29 122 views
0

我想在我的Ubuntu 15.4操作系統上安裝名爲telnetlib的python模塊。安裝Python telnetlib模塊

我想:

$ pip install telnetlib 

,但我得到的錯誤:

[email protected]:~# pip install telnetlib 
Collecting telnetlib 
Could not find a version that satisfies the requirement telnetlib (from versions:) 
No matching distribution found for telnetlib 
[email protected]:~# 

我嘗試安裝telnetlib以及telnetlib3但所有給我相同的結果。

這裏是telnetlib Python文檔: https://docs.python.org/2/library/telnetlib.html

關於如何安裝該模塊的任何幫助將不勝感激。

+0

如果您沒有它,它只是一個.py文件。 2.7版本位於hg.python.org/cpython/file/2.7/Lib/telnetlib.py,3.4版本位於hg.python.org/cpython/file/3.4/Lib/telnetlib.py。後者與Python 3.4.3 | Anaconda 2.3.0中安裝的基本相同 - 在註釋中使用True而不是1等方式存在一些差異。 –

回答

2

鑑於telnetlib是一個庫,只要你有python,你就不需要安裝這個模塊。你可以只做 import telnetlib

來自python解釋器或你的python程序。

一般來說,如果它在docs.python.org庫中,它就是內置到python中的。如果您嘗試使用pip安裝某些內容並遇到問題,請嘗試在pypi.python.org上進行搜索以查看該名稱是否與您期望的名稱稍有不同

+0

謝謝!我是python的新手,那個答案幫了我很大的忙! :d –