Juicy
Juicy

Reputation: 12530

Python-ping module not found after installation

I tried to install python-ping with pip but I was getting:

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

So I installed it with pip install --pre python-ping and the installation outputted:

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...

Despite the warnings I assumed it was successful.

I then tried to import the ping module to give it a test, copy-pasting the first answer here, but I'm getting:

ImportError: No module named ping

First time I encounter any problems installing a module with pip. How can I fix this?

Upvotes: 0

Views: 6850

Answers (1)

user590028
user590028

Reputation: 11738

According the the setup.py of the package of python-ping, it does not install a module, but instead installs a script (which should be installed in your python scripts folder). You should invoke the script directly, eg: ping.py www.google.com. If this does not work, make sure your path is set to include the python scripts folder on your system.

If you'd prefer a module solution, check out ping on pypi, https://pypi.python.org/pypi/ping/0.2

Upvotes: 1

Related Questions