Python-安装后未找到ping模块
Python-ping module not found after installation
我尝试用 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
安装模块时遇到任何问题。我该如何解决这个问题?
根据 python-ping
包的 setup.py
,它不安装模块,而是安装脚本(应该安装在您的 python 脚本文件夹中) .您应该直接调用脚本,例如:ping.py www.google.com
。如果这不起作用,请确保您的路径设置为包含系统上的 python 脚本文件夹。
如果您更喜欢模块解决方案,请在 pypi 上查看 ping
,https://pypi.python.org/pypi/ping/0.2
我尝试用 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
安装模块时遇到任何问题。我该如何解决这个问题?
根据 python-ping
包的 setup.py
,它不安装模块,而是安装脚本(应该安装在您的 python 脚本文件夹中) .您应该直接调用脚本,例如:ping.py www.google.com
。如果这不起作用,请确保您的路径设置为包含系统上的 python 脚本文件夹。
如果您更喜欢模块解决方案,请在 pypi 上查看 ping
,https://pypi.python.org/pypi/ping/0.2