Summary: | app-portage/layman aborting with message "ImportError: cannot import name 'DependencyWarning'" | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Marius <marius> |
Component: | Current packages | Assignee: | Layman Overlay Manager project <layman> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | dev-portage, marius |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Marius
2017-03-26 21:32:29 UTC
import requests File "/usr/lib64/python3.4/site-packages/requests/__init__.py", line 60, in <module> from .packages.urllib3.exceptions import DependencyWarning ImportError: cannot import name 'DependencyWarning' This error is caused by internal dev-python/requests code. Please try re-emerging dev-python/requests to see if that resolves the problem. Zac, is the _native_kwargs error something that still needs fixing in portage? I performed an emerge -e dev-python/requests and rebooted my system, unfortunately I'm still seeing those issues. Next on the suspect list then is python3.4. You have another python installe, try switching to python2.7? Hopefully portage/layman is installed to that python as well. If so, do you get those same errors with that other python? Thanks Brian, indeed switching Python versions helped here. What I did: eselect python set python2.7 emerge --sync (In reply to Brian Dolbec from comment #1) > Zac, is the _native_kwargs error something that still needs fixing in > portage? We removed _native_kwargs in 2.3.0 since it was only only neeeded for Python < 2.6.5: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9590cb4bf4140e3fc5610b1ea0e290b2df93c24a Thanks Zac. So, your python-3.4 install is totally messed up then. You should probably re-emerge python-3.4 to be safe and probably re-emerge any python programs you want installed to it. It will be hard to tell which of them may be broken. There must have been a recent portage upgrade that didn't make into you messed up 3.4 install. Check your make.conf PYTHON_TARGETS variable to be sure it is still set correctly. I've tried `emerge -e python && eselect python set python3.4 && emerge --sync`, unfortunately layman still failed. So I tried `emerge layman` (while 2.7 was active) and this happened:
>>> Installing (1 of 1) app-portage/layman-2.4.2::gentoo
* Running layman-updater...
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.4/layman-updater", line 21, in <module>
from layman.updater import Main
File "/usr/lib64/python3.4/site-packages/layman/updater.py", line 12, in <module>
from layman.api import LaymanAPI
File "/usr/lib64/python3.4/site-packages/layman/api.py", line 25, in <module>
from layman.remotedb import RemoteDB
File "/usr/lib64/python3.4/site-packages/layman/remotedb.py", line 46, in <module>
from sslfetch.connections import Connector
File "/usr/lib64/python3.4/site-packages/sslfetch/connections.py", line 40, in <module>
import requests
File "/usr/lib64/python3.4/site-packages/requests/__init__.py", line 60, in <module>
from .packages.urllib3.exceptions import DependencyWarning
ImportError: cannot import name 'DependencyWarning'
Then I activated 3.4 and re-tried emerging layman, resulting in the same output.
I'm not quite sure what's wrong here, but all I can say is that every other Python program besides layman seems to be working just fine.
(In reply to Marius from comment #7) > from .packages.urllib3.exceptions import DependencyWarning > ImportError: cannot import name 'DependencyWarning' It looks like you need a newer version of urllib3. The DependencyWarning exception is not available in dev-python/urllib3-1.12, so we'll have to require a newer version in the layman ebuilds. See this commit which is present only in tags since 1.14: https://github.com/shazow/urllib3/commit/4f12e74955c7356e9d839d3ff776600cd4f61f89 Actually it's the dev-python/requests dependencies that were wrong. Fixed now: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6dcba13330f43b79d6e9e459287a7111892e0389 (In reply to Marius from comment #0) > "/usr/lib64/python3.4/site-packages/portage/sync/modules/laymansync/subproc. > py", line 114, in update > **portage._native_kwargs(self.spawn_kwargs)) > AttributeError: 'module' object has no attribute '_native_kwargs' It looks like this still needs to be fixed, because the current code still uses portage._native_kwargs: https://github.com/gentoo/layman/blob/2.4.1/pm_plugins/portage/sync/modules/laymansync/subproc.py#L75 Pull request sent: https://github.com/gentoo/layman/pull/41 I merged the pull request to the GitHub codebase. I'll be pushing those commits to the Gentoo git repo as well. Fixed in 2.4.3 (thx to joecool for noticing). |