【发布时间】:2015-02-07 19:55:14
【问题描述】:
我尝试使用pip 安装python-ping,但我得到了:
Downloading/unpacking python-ping
Could not find a version that satisfies the requirement python-ping (from versions: 2011.10.12.11fc9f7, 2011.10.12.1d8e600, 2011.10.13.12050a5, 2011.10.17.376a019)
Cleaning up...
No distributions matching the version for python-ping
Storing debug log for failure in /root/.pip/pip.log
所以我用pip install --pre python-ping安装了它,安装输出:
Downloading/unpacking python-ping
Downloading python-ping-2011.10.17.376a019.tar.gz
Running setup.py (path:/tmp/pip-build-8QnXqD/python-ping/setup.py) egg_info for package python-ping
warning: no previously-included files matching '*.pyc' found under directory '*'
warning: no previously-included files matching '*.pyo' found under directory '*'
Installing collected packages: python-ping
Running setup.py install for python-ping
changing mode of build/scripts-2.7/ping.py from 644 to 755
warning: no previously-included files matching '*.pyc' found under directory '*'
warning: no previously-included files matching '*.pyo' found under directory '*'
changing mode of /usr/bin/ping.py to 755
Successfully installed python-ping
Cleaning up...
尽管有警告,但我认为它是成功的。
然后我尝试导入 ping 模块进行测试,复制粘贴 first answer here,但我得到了:
ImportError: No module named ping
我第一次使用pip 安装模块时遇到任何问题。我该如何解决这个问题?
【问题讨论】:
-
你总是可以使用子进程来 ping 并忘记使用库
-
@PadraicCunningham 它不会是跨平台的。