-
Notifications
You must be signed in to change notification settings - Fork 92
"ImportError: cannot import name 'Connection' #39
Comments
Hi. I'm having the same problem with using python 3.5.2 with bitly_api. |
from bitly_api import bitly_api |
Same for me. Python 3.5.2 Windows 10. |
Approved. Windows 10 x64, PyCharm 2016.3 Python 3.5.2 |
@scott-plutovr @mithun-dhali-cookifi @jawwolfe @julianl28 |
I had the same problem and given the lack of support for this library, I've switched to https://github.com/ellisonleao/pyshorteners
It arguably adds some code I don't need for the others shorteners, but if one day I want to switch to another service, there is normalised API. |
Same problem on OSX using Python 3.5.2 |
I ended up using my own small snippet. Since it was not that complex i avoided using any lib.
|
@szabgab You can use code from master branch. Since PyPI has non >Python3.5 compatible code with tag v0.3 |
@TheGuyverjoke thanks. For now I am good with the snippet provided by @mithun-dhali-cookifi |
@mithun-dhali-cookifi that one has a requests dependency and the url is not encoded so longer urls which contains &, ? will not be shortened. Here is an improved solution: https://gist.github.com/VISWESWARAN1998/24af6f2aa01f43f84c6850718593deb3 |
http://docs.python-requests.org/en/master/user/quickstart/#passing-parameters-in-urls The implementation does require requests. But since requests is very popular and we were already using it, it made sense for us. There may be some new library available. I have not checked recently. |
This repo seems abandoned by its original creator. At the writing point in time i got it working. |
@jimmy927 I've cloned on macOS and installed ( |
My clone is not available on PyPI ( i think ...) I changed the documentation accordingly. |
Awesome that worked - cheers :) |
Had the same issue but the API provided by @jimmy927 worked perfectly you saved my life. |
Perhaps you could release it on pypi. How to include this on requirement.txt for a herku python app ? |
Does it work if you put "git+git://github.com/jimmy927/bitly-api-python" in your requirements.txt ? |
Sorry if this is really obvious, I'm new to Python. When I try to import the bitly_api library into my application I get the above error. To narrow down the problem (in case it was one of the other libraries I was using) I created a new program with just 'import bitly_api' in it, nothing else. I still get the error below.
`"C:\Program Files\Python35\python.exe" C:/Users/julianl/Documents/Python/test_bitly_api.py
Traceback (most recent call last):
File "C:/Users/julianl/Documents/Python/test_bitly_api.py", line 12, in
import bitly_api
File "C:\Program Files\Python35\lib\site-packages\bitly_api__init__.py", line 1, in
from bitly_api import Connection, BitlyError, Error
ImportError: cannot import name 'Connection'
Process finished with exit code 1`
I'm on Windows 10, Python 3.5.1, using the PyCharm Community Edition 2016.2.3 IDE, and bitly_api library v0.3.
The text was updated successfully, but these errors were encountered: