0

This is a follow up to this question. I have installed httplib2 using python setup.py install the file I did this on was on my Desktop. Now I have to include the installed module in my PYTHONPATH in eclipse, my question is how? I assume it involves finding where httplib2 has been installed and then adding that path, but I have no clue where it has been installed to or how to easily find it.

Update: I am running the latest version of OSX and eclipse. I am using a build configuration to run it locally, which requires a browser so I can see the page on localhost 8080. At this point I have included site-packages/httplib2-0.8-py2.7.egg as an folder(because it wouldn't let me include it as an egg) in external libraries. I have restarted eclipse, and my mac, and yet `

ImportError: No module named httplib2

Community
  • 1
  • 1
EasilyBaffled
  • 3,822
  • 10
  • 50
  • 87
  • If you installed successfully, the module should be already installed on your PYTHONPATH. However, you will probably need to restart the program and log off the user and log back in. If that still does not work, you will probably have to do a full restart. – Josh Jun 24 '13 at 15:39
  • @Josh you don't need to do a restart of the system, but restarting the server is definitely important. The `PYTHONPATH` itself has not changed, as any directories in it are automatically searched for subdirectories. The OP can import the module from the command line, just not in his server (see comments on my answer below) – MattDMo Jun 24 '13 at 15:47

1 Answers1

1

Running python setup.py install will install the files along with all of your other modules, and this location is already in your PYTHONPATH. On Windows, this is c:\PythonX.X\lib\site-packages\ (where X.X is the version of Python), on Linux it's typically something like /usr/lib/pythonX.X/site-packages/, and for the python.org installation on OSX it's /Library/Frameworks/Python.framework/Versions/X.X/lib/pythonX.X/site-packages/.

You should now be able to either run python from the command line, or open IDLE, type import httplib2, and see the following:

>>> import httplib2
>>> 

Meaning, it imported successfully, without any errors. You can now use this module, and any others you install with the same method, in your programs.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • So here's an odd thing I ran the interpreter and tried import httplib2, There were no problems, but when I try to run a project on localhost 8080 I stil get no such module and I tried to find it in the path you said, but httplib2 and site-packages are no where to be found. – EasilyBaffled Jun 24 '13 at 14:42
  • @EasilyBaffled please update your question with what exactly you're trying to do and your system setup: version of python, OS, how you're "running a project on localhost:8080", any other third-party modules you've successfully imported (or not), the exact text of any errors you're receiving, that kind of thing. Better info begets better answers :) – MattDMo Jun 24 '13 at 14:46
  • I've updated the question. I think it might have a problem with the .egg part of it, but I have tried python setup.py install, and pip. The thing is in there. – EasilyBaffled Jun 24 '13 at 22:09