0

I'm trying to install a particular python library (https://github.com/bitly/bitly-api-python/).

The recommended method is using pip, but pip doesn't work behind my university's authenticated proxy system. So I'm trying to install it manually. It has a setup.py file. I tried to do sudo python setup.py install and it said:

running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing bitly_api.egg-info/PKG-INFO
writing top-level names to bitly_api.egg-info/top_level.txt
writing dependency_links to bitly_api.egg-info/dependency_links.txt
reading manifest file 'bitly_api.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'bitly_api.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/bitly_api
copying build/lib.linux-x86_64-2.7/bitly_api/__init__.py -> build/bdist.linux-x86_64/egg/bitly_api
copying build/lib.linux-x86_64-2.7/bitly_api/bitly_http.py -> build/bdist.linux-x86_64/egg/bitly_api
copying build/lib.linux-x86_64-2.7/bitly_api/bitly_api.py -> build/bdist.linux-x86_64/egg/bitly_api
byte-compiling build/bdist.linux-x86_64/egg/bitly_api/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/bitly_api/bitly_http.py to bitly_http.pyc
byte-compiling build/bdist.linux-x86_64/egg/bitly_api/bitly_api.py to bitly_api.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying bitly_api.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying bitly_api.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying bitly_api.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying bitly_api.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying bitly_api.egg-info/zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/bitly_api-0.2-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing bitly_api-0.2-py2.7.egg
removing '/usr/local/lib/python2.7/dist-packages/bitly_api-0.2-py2.7.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/bitly_api-0.2-py2.7.egg
Extracting bitly_api-0.2-py2.7.egg to /usr/local/lib/python2.7/dist-packages
bitly-api 0.2 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/bitly_api-0.2-py2.7.egg
Processing dependencies for bitly-api==0.2
Finished processing dependencies for bitly-api==0.2

Which looks like a successfull installation. But then if I say python and then import bitlyapi, python says ImportError: No module named bitlyapi.

What am I doing wrong?

Btw I was following this guide: http://www.pythonforbeginners.com/code-snippets-source-code/bitly-shortener-with-python/

1
  • Are you activated in a virtualenv? Commented Feb 5, 2013 at 19:50

1 Answer 1

2

The name of the directory seams to be bitly_api.

So import bitly_api in python

Sign up to request clarification or add additional context in comments.

3 Comments

The name of library can be found in the setup.py. It is in fact bitly_api github.com/bitly/bitly-api-python/blob/master/setup.py
Chicken or the "egg" :-) guide.python-distribute.org/creation.html Check the name='TowelStuff', however "from towelstuff import location"
Oh wow, how dumb of me. That guide has it wrong then, should've double checked.

Your Answer

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.