-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_NamespacePath object has no attribute sort (31.0.0) #885
Comments
From what I can tell, this is a 3.5-only failure. |
I can trigger the error just by importing setuptools. However, when I do it a second time, it imports fine. So, if I do something like this, the install succeeds. try:
from setuptools import setup, find_packages
except AttributeError:
from setuptools import setup, find_packages |
I tried adding a test to capture the failure, but the test is passing. So to some extent it's working. Why is the test working but your package not? |
@jaraco The bug happens trying to import In @jkbbwr's case above, what would cause
As a hackaround, one might add monkeypatch a |
I've just pushed another commit, this one in the |
It's almost certainly the fact that the new -nspkg.pth files are using I continue to be unable to replicate the error indicated. Here's one such attempt:
What steps do you have to invoke to get a virtual environment that replicates this issue? |
This is also occurring consistently over at https://github.com/GoogleCloudPlatform/google-auth-library-python in our lint tox (sample failure). It'll also occur in other tox environment if you run them twice. The first time tox creates the environment from scratch, but when it tries to re-use an existing environment it 'splodes. Let me know if I can do anything else to help reproduce/fix this. |
Excellent. That does help. I simply checked out GoogleCloudPlatform/google-auth-library-python and ran |
Awesome. 👍 |
I just hit this same problem. I can craft a reproducer if you need it. I see it when running tox on a py35 environment with flufl.i18n, which uses flufl.testing, both of which are namespace packages. I need to commit and push a fix to the latter for you to reproduce it. Let me know if you need it, but it would be really great to get a quick fix released for this bug. |
FWIW, it affects Python 3.6 also; I can't test 3.4. |
Working with the google-auth library, I find that if I set |
@jaraco That's interesting because I have |
usedevelop probably won't work except in that specific case because
google-auth uses namespace packages.
…On Tue, Dec 13, 2016, 6:01 PM Jason R. Coombs ***@***.***> wrote:
Working with the google-auth library, I find that if I set usedevelop =
True in the tox settings, the issue doesn't occur. This behavior
indicates to me that the issue lies in part with a package which is
duplicately installed. In any case, I was able to use it to create a test
case that captures the error.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#885 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPUcwf9-z3hwrnuPlbbGLeyiea38dH-ks5rH04MgaJpZM4LKdo7>
.
|
…n the current working directory. Ref #885.
@jonparrott: The whole point of v31.0.0 and the fix for #250 is that 'develop' and namespace packages should work well together now, so I hope you can drop that assumption soon. @warsaw: The fix is in place. Can you update setuptools in your test environment to git+https://github.com/pypa/setuptools@3943cf4 and see if that addresses the manifestation you encountered? |
Well hell. The fix works for Python 3.6 but not for Python 3.5. Thanks to Travis for catching that. |
Okay. Yet another version to test against, this one passes on Python 3.5. git+https://github.com/pypa/setuptools@7c0c39ef. I'm not happy with the fix, but it passes the tests. |
@jaraco I get another bug now:
|
I've unlocked the conversation here. Others have pointed out that there are other ways users can encounter this issue, so might as well make this issue a wiki about the ways people can encounter the issue and how they worked around it. |
It is still a problem on Ubuntu 16.04. It is easy to simulate it with /usr/lib/python/python2.7/ /usr/local/lib/python2.7/ Why is there such a mess after one is using standard routines to install packages (either apt or pip) ?! |
I'm unable to replicate your findings:
(also running simply
Setuptools fixed this in 31.0.1. Pip incorporated the fix in 10.0.0b1. |
Maybe this another kind of this issue:
|
Upgrade doesn't help but uninstall setuptools then reinstall fixed it for me. I am using Ubuntu 16.04.03 in virtualenv.
What works:
Hope it helps someone else! |
Still experiencing this issue, fresh virtualenv and setuptools reinstallation did not help. |
@Belval you have a fix for this ? setuptools -39.2.0 |
I was running into the same issue, when I went to recreate the virtualenv the version of python I was using, |
#700) * Add hovorod trainer. * fix * working on the mnist tutorial. * fix build error * first working demo * is_fix=True * working on fixing hao comments * Fix more hao comments. * fix * fix * add todos * fix * fix runtime error * fix lints * fix * Deprecated old distributed APIs. * check in the script to help users install distributed runner environment. * wip: validation. * minor * fix * fix * Add validation * wip: validation loss. * validatioin works * minor * clean code * simplify * improve the APIs * fix codacy * install libopenmpi-dev before building docs * run apt as root * fix API * revert openmpi and horovod installation * format code * more API tuning. * more API refine * rename * fix lints * simplify code * fix code. * we must guard the use of session after should stop is set. * fix bug * test validation. * Add documentation. * add more comments. * minor * install openmpi and horovod when build doc * fix yapf errors. * yapf * fix installing horovod * requirements_distributed.txt * add distributed tp extras_require * install openmpi when READTHEDOCS=True * custom_build_ext * simplify * fix cmdclass * try fix * try fix * fix import * fix * use setup_py_install * disable codacy for scripts * disable bandit engine * add Trainer to autosummary * autofunction:: Trainer * fix * disable codacy for setup.py * remove Trainer from doc * add Dockerfile for building docs locally * disable crazy codary for docker files! * check in a script to help install cuda 9 and cuDNN 7 * fix * minor fix * add cifar10 example for distributed trainer * change default parameters * add a log storage option for tensor db. * add comments * tensordb * remove the tensordb example. * add changelog * update scripts * remove tensordb option * add option for learning rate. * more comments. * add an option * fix logging * fix .travis.yml * fix format * build doc with python 3.6 (pypa/setuptools#885) * use latest RTD builder * try fix rtd * try fix rtd * use absolute path * fix SCRIPT_DIR
Hi, is there a fix/workaround for this? I am getting the "sort" error even when I try I am using a mac High Sierra. |
Try this workaround: Edit line #2121~2122 of this file:
|
@lechatthecat <3 thank you very much it worked |
#700) * Add hovorod trainer. * fix * working on the mnist tutorial. * fix build error * first working demo * is_fix=True * working on fixing hao comments * Fix more hao comments. * fix * fix * add todos * fix * fix runtime error * fix lints * fix * Deprecated old distributed APIs. * check in the script to help users install distributed runner environment. * wip: validation. * minor * fix * fix * Add validation * wip: validation loss. * validatioin works * minor * clean code * simplify * improve the APIs * fix codacy * install libopenmpi-dev before building docs * run apt as root * fix API * revert openmpi and horovod installation * format code * more API tuning. * more API refine * rename * fix lints * simplify code * fix code. * we must guard the use of session after should stop is set. * fix bug * test validation. * Add documentation. * add more comments. * minor * install openmpi and horovod when build doc * fix yapf errors. * yapf * fix installing horovod * requirements_distributed.txt * add distributed tp extras_require * install openmpi when READTHEDOCS=True * custom_build_ext * simplify * fix cmdclass * try fix * try fix * fix import * fix * use setup_py_install * disable codacy for scripts * disable bandit engine * add Trainer to autosummary * autofunction:: Trainer * fix * disable codacy for setup.py * remove Trainer from doc * add Dockerfile for building docs locally * disable crazy codary for docker files! * check in a script to help install cuda 9 and cuDNN 7 * fix * minor fix * add cifar10 example for distributed trainer * change default parameters * add a log storage option for tensor db. * add comments * tensordb * remove the tensordb example. * add changelog * update scripts * remove tensordb option * add option for learning rate. * more comments. * add an option * fix logging * fix .travis.yml * fix format * build doc with python 3.6 (pypa/setuptools#885) * use latest RTD builder * try fix rtd * try fix rtd * use absolute path * fix SCRIPT_DIR
I had the same problem using poetry. Running
instead of
fixed the issue. |
on certain distros, buggy pip and setuptools are used, so we need to upgrade them first. see also: googleapis/google-cloud-python#2990 and pypa/setuptools#885 Signed-off-by: Kefu Chai <kchai@redhat.com>
on certain distros, buggy pip and setuptools are used, so we need to upgrade them first. see also: googleapis/google-cloud-python#2990 and pypa/setuptools#885 Signed-off-by: Kefu Chai <kchai@redhat.com>
When pip installing a package that shares a namespace it fails out on 31.0.0 but installs fine on 28.8.0
The text was updated successfully, but these errors were encountered: