On 22/02/18 15:06, Larry Martell wrote:
On Thu, Feb 22, 2018 at 2:00 AM, Chris Angelico <ros...@gmail.com> wrote:
On Thu, Feb 22, 2018 at 5:27 PM, Larry Martell <larry.mart...@gmail.com> wrote:
I want to use the atws package
(https://atws.readthedocs.io/readme.html). I am using python 2.7.6 on
ubuntu-trusty-64 3.13.0-87-generic. I get this error when importing
the package:

import atws
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.7/dist-packages/atws/__init__.py", line
4, in <module>
     from .wrapper import connect
   File "/usr/local/lib/python2.7/dist-packages/atws/wrapper.py", line
32, in <module>
     from . import connection
   File "/usr/local/lib/python2.7/dist-packages/atws/connection.py",
line 19, in <module>
     from requests.exceptions import ConnectTimeout, Timeout,
ReadTimeout, SSLError
ImportError: cannot import name ConnectTimeout

I would not be surprised if no one here has used this package, but has
anyone seen this error in other packages or their own work?

You're running that on a fairly old version of Python (2.7.6 - the
latest in the 2.x branch is 2.7.14). It's entirely possible that the
app doesn't support the versions of Python and/or the 'requests'
library that you have installed.

First thing to try: can you use the app under Python 3?

This is a mature django app and I cannot switch to Python 3.

For reference, here's the version of requests that I have (which does
have that exception available):

import requests

What's yours?

I had 2.2.1. I updated requests to 2.18.4 and now when I import atws I get:

No handlers could be found for logger "atws.connection"

I get exactly the same thing, but do the import interactively and then help(atws) shows help so I'm guessing that it's just a poor informational message, so I suggest that you just try running your code and see what happens.

p.s. enjoying the curling at the Winter Olympics?

My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence


Reply via email to