PyLint errors "Unable to import" on rev 1220

Asked by Aaron Whitehouse on 2016-06-08

On the latest revision for me (rev 1220), I'm getting failed tests on a clean branch. The first is a pep8 error about a bracket that I've quickly fixed, but the other is a pylint error about not being able to import a bunch of modules. A quick Google suggests that this can be about Python PATH settings, so before I spend too much time on it I wanted to know if this is working for other people or if trunk has failing tests (oh for a hosted repository that supports CI...)

test_pylint (testing.test_code.CodeTest)
Pylint test (requires pylint to be installed to pass) ... FAIL

======================================================================
FAIL: test_pylint (testing.test_code.CodeTest)
Pylint test (requires pylint to be installed to pass)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/aaron/Programming/duplicity/dup_ro_error/testing/test_code.py", line 86, in test_pylint
    [0, 32])
  File "/home/aaron/Programming/duplicity/dup_ro_error/testing/test_code.py", line 40, in run_checker
    self.assertTrue(process.returncode in returncodes, output)
AssertionError: ************* Module duplicity.backends._boto_single
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/_boto_single.py:131: [E0401(import-error), BotoBackend.__init__] Unable to import 'boto.s3.connection'
************* Module duplicity.backends._cf_cloudfiles
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/_cf_cloudfiles.py:71: [E0401(import-error), CloudFilesBackend._error_code] Unable to import 'cloudfiles.errors'
************* Module duplicity.backends.pydrivebackend
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:45: [E0401(import-error), PyDriveBackend.__init__] Unable to import 'oauth2client.client'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:48: [E0401(import-error), PyDriveBackend.__init__] Unable to import 'oauth2client.service_account'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:49: [E0401(import-error), PyDriveBackend.__init__] Unable to import 'oauth2client'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:95: [E0401(import-error), PyDriveBackend.file_by_name] Unable to import 'pydrive.files'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:184: [E0401(import-error), PyDriveBackend._error_code] Unable to import 'pydrive.files'
************* Module duplicity.backends.dpbxbackend
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/dpbxbackend.py:39: [E0401(import-error), ] Unable to import 'dropbox'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/dpbxbackend.py:40: [E0401(import-error), ] Unable to import 'dropbox.exceptions'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/dpbxbackend.py:41: [E0401(import-error), ] Unable to import 'dropbox.files'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/dpbxbackend.py:43: [E0401(import-error), ] Unable to import 'dropbox.oauth'
************* Module duplicity.backends.pyrax_identity.hubic
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pyrax_identity/hubic.py:14: [E0401(import-error), ] Unable to import 'pyrax.base_identity'

Question information

Language:
English Edit question
Status:
Solved
For:
Duplicity Edit question
Assignee:
No assignee Edit question
Solved by:
Aaron Whitehouse
Solved:
2016-06-11
Last query:
2016-06-11
Last reply:
2016-06-09

PEP8 issue patch is here:
http://paste.ubuntu.com/17129345/

Annoyingly, Bazaar has stopped working properly for me since 16.04 upgrade and keeps hanging indefinitely without giving useful errors...

I run the code tests before releasing new code. Here's what I got.

ken@dione:~/workspace/duplicity-src$ RUN_CODE_TESTS=1 python -u setup.py test -s testing.test_code.CodeTest
/usr/local/lib/python2.7/site-packages/setuptools/dist.py:294: UserWarning: The version specified ('$version') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
running test
running egg_info
writing requirements to duplicity.egg-info/requires.txt
writing duplicity.egg-info/PKG-INFO
writing top-level names to duplicity.egg-info/top_level.txt
writing dependency_links to duplicity.egg-info/dependency_links.txt
reading manifest file 'duplicity.egg-info/SOURCES.txt'
writing manifest file 'duplicity.egg-info/SOURCES.txt'
running build_ext
copying build/lib.macosx-10.11-x86_64-2.7/duplicity/_librsync.so -> duplicity
test_2to3 (testing.test_code.CodeTest) ... ok
test_pep8 (testing.test_code.CodeTest) ... ok
test_pylint (testing.test_code.CodeTest)
Pylint test (requires pylint to be installed to pass) ... ok

----------------------------------------------------------------------
Ran 3 tests in 30.360s

OK

Is it possible you're running native Python 3??

The error you fixed would be handled by 2to3 conversion. There are a lot of them left to do.

Thanks Ken,

No, I'm not running Python 3:
$ python --version
Python 2.7.11+

But copying and pasting your command, mine still fails:

$ RUN_CODE_TESTS=1 python -u setup.py test -s testing.test_code.CodeTest
/usr/lib/python2.7/dist-packages/setuptools/dist.py:294: UserWarning: The version specified ('$version') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  "details." % self.metadata.version
running test
running egg_info
writing requirements to duplicity.egg-info/requires.txt
writing duplicity.egg-info/PKG-INFO
writing top-level names to duplicity.egg-info/top_level.txt
writing dependency_links to duplicity.egg-info/dependency_links.txt
reading manifest file 'duplicity.egg-info/SOURCES.txt'
writing manifest file 'duplicity.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-x86_64-2.7/duplicity/_librsync.so -> duplicity
test_2to3 (testing.test_code.CodeTest) ... ok
test_pep8 (testing.test_code.CodeTest) ... ok
test_pylint (testing.test_code.CodeTest)
Pylint test (requires pylint to be installed to pass) ... FAIL

======================================================================
FAIL: test_pylint (testing.test_code.CodeTest)
Pylint test (requires pylint to be installed to pass)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/aaron/Programming/duplicity/dup_ro_error/testing/test_code.py", line 86, in test_pylint
    [0, 32])
  File "/home/aaron/Programming/duplicity/dup_ro_error/testing/test_code.py", line 40, in run_checker
    self.assertTrue(process.returncode in returncodes, output)
AssertionError: ************* Module duplicity.backends._boto_single
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/_boto_single.py:131: [E0401(import-error), BotoBackend.__init__] Unable to import 'boto.s3.connection'
************* Module duplicity.backends._cf_cloudfiles
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/_cf_cloudfiles.py:71: [E0401(import-error), CloudFilesBackend._error_code] Unable to import 'cloudfiles.errors'
************* Module duplicity.backends.pydrivebackend
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:45: [E0401(import-error), PyDriveBackend.__init__] Unable to import 'oauth2client.client'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:48: [E0401(import-error), PyDriveBackend.__init__] Unable to import 'oauth2client.service_account'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:49: [E0401(import-error), PyDriveBackend.__init__] Unable to import 'oauth2client'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:95: [E0401(import-error), PyDriveBackend.file_by_name] Unable to import 'pydrive.files'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pydrivebackend.py:184: [E0401(import-error), PyDriveBackend._error_code] Unable to import 'pydrive.files'
************* Module duplicity.backends.dpbxbackend
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/dpbxbackend.py:39: [E0401(import-error), ] Unable to import 'dropbox'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/dpbxbackend.py:40: [E0401(import-error), ] Unable to import 'dropbox.exceptions'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/dpbxbackend.py:41: [E0401(import-error), ] Unable to import 'dropbox.files'
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/dpbxbackend.py:43: [E0401(import-error), ] Unable to import 'dropbox.oauth'
************* Module duplicity.backends.pyrax_identity.hubic
/home/aaron/Programming/duplicity/dup_ro_error/duplicity/backends/pyrax_identity/hubic.py:14: [E0401(import-error), ] Unable to import 'pyrax.base_identity'

----------------------------------------------------------------------
Ran 3 tests in 44.361s

FAILED (failures=1)

The PEP8 error was because there was a space between the print and the following bracket, rather than because it was quotes rather than brackets. Not sure if 2to3 fixes that as well, but I've now got bazaar working again and submitted that change.

Sorry, simple fix -- I didn't have the required packages on my machine:
$ sudo pip install boto python-cloudfiles oauth2client pydrive dropbox pyrax

I didn't think that could be the problem, as I'd already tried adding those as tox dependencies and it didn't fix. Guess I was trying to be too clever...

What versions of pep8 and pylint?

On Sat, Jun 11, 2016 at 6:12 AM, Aaron Whitehouse <
<email address hidden>> wrote:

> Question #295069 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/295069
>
> Status: Open => Solved
>
> Aaron Whitehouse confirmed that the question is solved:
> Sorry, simple fix -- I didn't have the required packages on my machine:
> $ sudo pip install boto python-cloudfiles oauth2client pydrive dropbox
> pyrax
>
> I didn't think that could be the problem, as I'd already tried adding
> those as tox dependencies and it didn't fix. Guess I was trying to be
> too clever...
>
> --
> You received this question notification because your team duplicity-team
> is an answer contact for Duplicity.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~duplicity-team
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~duplicity-team
> More help : https://help.launchpad.net/ListHelp
>

$ pylint --version
No config file found, using default configuration
pylint 1.5.5,
astroid 1.4.5
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413]

$ pep8 --version
1.7.0

I don't have an answer at all! My setup on OS X is the same version, but
gives different results in this case.

Just a note, pylint 1.5.6 gives the same result, for me, as 1.5.5.

On Sat, Jun 11, 2016 at 7:02 AM, Aaron Whitehouse <
<email address hidden>> wrote:

> Question #295069 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/295069
>
> Aaron Whitehouse posted a new comment:
> $ pylint --version
> No config file found, using default configuration
> pylint 1.5.5,
> astroid 1.4.5
> Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
> [GCC 5.3.1 20160413]
>
> $ pep8 --version
> 1.7.0
>
> --
> You received this question notification because your team duplicity-team
> is an answer contact for Duplicity.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~duplicity-team
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~duplicity-team
> More help : https://help.launchpad.net/ListHelp
>