4

I'd like to use https://github.com/erikvold/Github-to-Lighthouse-Issue-Migrator/blob/master/migrator.py but in the comments starting on line 8 it says:

# pip install lighthouse-python-api (probably have to do this manually)

But when I try I get the following error:

$ pip install lighthouse-python-api
Downloading/unpacking lighthouse-python-api
 Could not find any downloads that satisfy the requirement lighthouse-python-api
No distributions at all found for lighthouse-python-api
Storing complete log in /Users/erikvold/.pip/pip.log

so I guess I need to install the package manually.. so can someone plz explain or link to docs that explain how to do this?

asked Sep 12, 2011 at 17:11
3
  • the package I want to manually install is here github.com/clintecker/python-lighthouse-api Commented Sep 12, 2011 at 17:12
  • 2
    That very page contains installation instructions. But anyway, someone should make the maintainer of the Lighthouse API to create a setup.py and ideally also a PyPI page. Installs that require more than a single command is so 1999. Commented Sep 12, 2011 at 17:16
  • 2
    pip install git+git://github.com/clintecker/python-lighthouse-api.git should work Commented Sep 13, 2011 at 19:26

1 Answer 1

6

As @delnan said, the maintainer of Lighthouse API should really create a setup.py script. Anyway, there are two ways to achieve what you want and both require an understand of python modules.

When you import a module in python like so:

import lighthouse

the interpretor searches for a file named lighthouse.py in the directory which the input script was run and if it cannot find it there it then searches in the directories specified by the environment variable PYTHONPATH. If you do not know what an environment variable is, I suggest reading up about them here: http://en.wikipedia.org/wiki/Environment_variable

If it can't find it in the directories specified by the PYTHONPATH envi var it then defaults to the sys.path var which is installation dependent.

What the maintainer of lighthouse is doing (I think) is symlinking these files from whatever directory he downloaded them to into his installation default directory. You can quickly figure out what this directory is by running the python interpretor and looking at the sys.path var:

>>> sys.path
['', '/usr/local/lib/python2.6/dist-packages/Paste-1.7.5.1-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/tornado-1.1-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/pymongo-1.10.1-py2.6-linux-x86_64.egg', '/usr/local/lib/python2.6/dist-packages/mongoengine-0.4-py2.6.egg', '/usr/local/lib/python2.6/dist-packages/django_debug_toolbar-0.8.5-py2.6.egg', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/usr/local/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0']

You can see that /usr/local/lib/pthon2.6/dist-packages/ is the folder all the modules are in. I believe this is where the maintainer is symlinking his files. THIS IS NOT A GOOD IDEA. You shouldn't modify this directly.

The better approach is to simply download the files and place them in the same directory as your script, or you should place them in a directory and add that directory to the PYTHONPATH environment var.

answered Sep 12, 2011 at 18:57
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.