Bug 1396158
Summary: | fails to remove the f24 version of the python2-requests after updating to f25 | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | mock <mark> |
Component: | python-requests | Assignee: | Fedora Infrastructure SIG <infra-sig> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 25 | CC: | cstratak, davidshumway, infra-sig, jeremy, rbean, sagarun |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-17 18:07:12 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
mock
2016-11-17 15:44:03 UTC
*** Bug 1396160 has been marked as a duplicate of this bug. *** Hey, thanks for the report. I wasn't able to reproduce this with a fresh F24 box that I dnf system-upgraded. Did you by chance use pip to install anything as root? (In reply to Jeremy Cline from comment #2) > Hey, thanks for the report. > > I wasn't able to reproduce this with a fresh F24 box that I dnf > system-upgraded. Did you by chance use pip to install anything as root? yes, i had installed a few things using pip. i don't remember them all, but i know i did add pip (upgrade), boto, awscli, and maybe moto. i was a super to install those. i did try to pip install the requests package via pip AFTER setting up the fpaste output (posted in the Actual results section of the ticket), and that wasn't working either. should i try downgrading via pip or do i need physically wipe out the effected modules from site-packages and try downloading again? is this just a permissions problem on the directory for the requests module? well, i just tried that, and it worked. i moved the requests directory from the /usr/lib/python2.7/site-packages directory to a tmp directory and then issued the dnf upgrade again. it pulled the pacakge down and removed the old one without problems. i think we can close this. ---- $ sudo dnf upgrade --refresh Atlassian Hipchat 194 kB/s | 57 kB 00:00 nuvolaplayer repository, component stable (fc23 x86_64) 19 kB/s | 11 kB 00:00 Opera packages 35 kB/s | 12 kB 00:00 Paper Project (Fedora_24) 25 kB/s | 144 kB 00:05 Failed to synchronize cache for repo 'google-chrome', disabling. Failed to synchronize cache for repo 'home_Horst3180', disabling. Dependencies resolved. ======================================================================================================================== Package Arch Version Repository Size ======================================================================================================================== Upgrading: python2-requests noarch 2.10.0-4.fc25 fedora 107 k Transaction Summary ======================================================================================================================== Upgrade 1 Package Total download size: 107 k Is this ok [y/N]: y Downloading Packages: python2-requests-2.10.0-4.fc25.noarch.rpm 545 kB/s | 107 kB 00:00 ------------------------------------------------------------------------------------------------------------------------ Total 59 kB/s | 107 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Upgrading : python2-requests-2.10.0-4.fc25.noarch 1/2 Cleanup : python2-requests-2.10.0-2.fc24.noarch 2/2 Verifying : python2-requests-2.10.0-4.fc25.noarch 1/2 Verifying : python2-requests-2.10.0-2.fc24.noarch 2/2 Upgraded: python2-requests.noarch 2.10.0-4.fc25 Complete! ---- Glad you got it sorted! Yeah, pip and dnf do not play well together since neither one is aware of the other, and this is especially painful with requests because upstream bundles all their libraries inside their package and we unbundle them. I would generally recommend to not sudo pip install if you can avoid it, since you'll occasionally hit issues like this (or suddenly certain imports don't work). Yes So this also solved the problem of upgrading from 24 to 25 for python2-requests-2.10.0-4.fc25.noarch.
>>"i moved the requests directory from the /usr/lib/python2.7/site-packages directory to a tmp directory and then issued the dnf upgrade again."
However, I then moved the site-packages folder back to /usr/lib/python2.7/site-packages and did "dnf upgrade --refresh". Is this correct? It is odd because there are some software programs which require python which are now missing dependencies. For example in a scrapy program the following message appears when running scrapyd-deploy (which did not appear prior to this): "{"status": "error", "message": "ImportError: No module named cssselect"}".
Or for example:
>>$ pip install cssselect
>>Traceback (most recent call last):
>> File "/usr/bin/pip", line 7, in <module>
>> from pip import main
>>ImportError: No module named pip
Pip was here before moving site-packages around.
Oh, you definitely don't want to move it back. You also definitely should not mix ``sudo pip install`` with dnf-installed packages. >>Oh, you definitely don't want to move it back. You also definitely should not mix ``sudo pip install`` with dnf-installed packages.
So by not moving it back now how does python know what modules are available? For example pip was available and now is no longer available.
Thanks for your help btw... For example /usr/lib/python2.7/site-packages/ now contains:
>>examples requests requests-2.10.0-py2.7.egg-info tweepy tweepy-2.3.0-py2.7.egg-info
Did you move the entire ``site-packages`` directory? Hm. Yes, probably. In the site-packages folder that has been moved to /tmp there are 572 items. Is it enough to simply move the 572 files back to the /usr/lib/python2.7/site-packages/ folder? You can try that, but if you used dnf to upgrade packages after you moved site-packages, things might be broken. Maybe try downgrading any packages you upgraded before you moved everything, move everything back, move _only_ the requests directory, upgrade again, and make sure everything works? Okay...
>>$ sudo cp -Rf /tmp/site-packages/* /usr/lib/python2.7/site-packages/
>>cp: cannot overwrite non-directory '/usr/lib/python2.7/site-packages/requests/packages/chardet' with directory '/tmp/abc/requests/packages/chardet'
>>cp: cannot overwrite non-directory '/usr/lib/python2.7/site-packages/requests/packages/urllib3' with directory '/tmp/abc/requests/packages/urllib3'
And now things are working again. Pip works. Other programs with dependencies work.
Well almost everything. Seeing this again:
>>$ ./retweet.py
>>Traceback (most recent call last):
>> File "./retweet.py", line 3, in <module>
>> import tweepy
>> File "build/bdist.linux-x86_64/egg/tweepy/__init__.py", line 14, in <module>
>> File "build/bdist.linux-x86_64/egg/tweepy/api.py", line 12, in <module>
>> File "build/bdist.linux-x86_64/egg/tweepy/binder.py", line 11, in <module>
>> File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 64, in <module>
>> from . import utils
>> File "/usr/lib/python2.7/site-packages/requests/utils.py", line 26, in <module>
>> from .compat import (
>>ImportError: cannot import name integer_types
Which is what was happening after upgrading from Fedora 24 to Fedora 25.
Did not downgrade anything. May try moving only requests directory and upgrading again... Maybe will try moving these and then upgrading...
>>requests requests-2.10.0-py2.7.egg-info tweepy tweepy-2.3.0-py2.7.egg-info
Hm. Well pip upgrade makes tweepy work again: >>sudo pip install --upgrade requests >>Collecting requests >> Downloading requests-2.13.0-py2.py3-none-any.whl (584kB) >> 100% || 585kB 642kB/s >>Installing collected packages: requests >> Found existing installation: requests 2.12.4 >> Uninstalling requests-2.12.4: >> Successfully uninstalled requests-2.12.4 >>Successfully installed requests-2.10.0 As noted in previous comment tweepy error was: >>Traceback (most recent call last): >> File "./retweet.py", line 3, in <module> >> import tweepy >> File "build/bdist.linux-x86_64/egg/tweepy/__init__.py", line 14, in <module> >> File "build/bdist.linux-x86_64/egg/tweepy/api.py", line 12, in <module> >> File "build/bdist.linux-x86_64/egg/tweepy/binder.py", line 11, in <module> >> File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 64, in <module> >> from . import utils >> File "/usr/lib/python2.7/site-packages/requests/utils.py", line 26, in <module> >> from .compat import ( >>ImportError: cannot import name integer_types Okay. Just so you know though, upstream requests bundles several libraries (which we unbundle at the moment), so if you ever 'sudo pip install requests', you won't be able to receive updates to requests from Fedora and other odd things might happen. There's work being done to make using ``sudo pip`` safe to do, but it's not done yet so at the moment, pip and dnf step on each others toes. Okay. So just did:
>>$sudo pip uninstall requests
>>$sudo dnf reinstall python2-requests tweepy
And tweepy works again.
|