Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the cannot import name integer_types error caused by compiling or packaging rpm with openstack nova

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This issue of the content of the editor will bring you about the openstack nova compilation or packaging rpm cannot import name integer_types error solutions, the article is rich in content and professional analysis and description for you, after reading this article, I hope you can get something.

When packaging nova through rpmbuild, the following error occurred:

File "/ usr/lib/python2.7/site-packages/keystoneauth2/session.py", line 26, in import requests File "/ usr/lib/python2.7/site-packages/requests/__init__.py", line 63, in from. Import utils File "/ usr/lib/python2.7/site-packages/requests/utils.py", line 26, in from .compat import (ImportError: cannot import name integer_types

A general view of the following error message shows that there should be a problem with the installation of the requests module in python. Check the previous dependent installation log and the following appears:

Failed: python2-requests.noarch 0vl 2.11.1-1.el7 python2-urllib3.noarch 0vl 1.16-1.el7

The installation of these two modules failed, so the two modules were installed separately, but both reported errors

Downloading packages: (1 kB 2): python2-urllib3-1.16-1.el7.noarch.rpm | 126 kB 00:00:00 (2 kB 2): python2-requests-2.11.1-1.el7.noarch.rpm | | 105 kB 00:00:00-| -Total 190 kB/s | | 231 kB 00:00:01 Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing: python2-urllib3-1.16-1.el7.noarch 1 Error unpacking rpm package python2-urllib3 2 Error unpacking rpm package python2-urllib3-1.16-1.el7.noarcherror: unpacking of archive failed on file / usr/lib/python2.7/site- | Packages/urllib3/packages/ssl_match_hostname: cpio: rename Installing: python2-requests-2.11.1-1.el7.noarch 2 Error unpacking rpm package python2-requests-2.11.1-1.el7.noarcherror: python2-urllib3-1.16-1.el7.noarch: install failederror: unpacking Of archive failed on file / usr/lib/python2.7/site-packages/requests/packages/chardet: cpio: rename Verifying: python2-urllib3-1.16-1.el7.noarch 1 Acer 2 Verifying: python2-requests-2.11.1-1.el7.noarch 2 Failed 2: python2-requests.noarch 0vl 2.11.1-1.el7 python2-urllib3.noarch 0vl 1.16-1.el7

There should be a problem with the existing version of these two modules, so delete the contents of these two modules in site-packages

[root@localhost site-packages] # rm-rf urlurlgrabber/ urllib3/ urllib3-1.21.dist-info/ urlgrabber-3.10-py2.7.egg-info urllib3-1.16-py2.7.egg-info/ [root@localhost site-packages] # rm-rf urllib3* [root@localhost site-packages] # rm-rf requestsrequests/ Requestsexceptions/ requests_mock/requests-2.11.1-py2.7.egg-info/ requestsexceptions-1.1.3-py2.7.egg-info/ requests_mock-1.3.0.dist-info/requests-2.13.0.dist-info/ requestsexceptions-1.2.0.dist-info/ [root@localhost site-packages] # rm-rf requests [root @ localhost site-packages] # rm-rf requests-*

Reinstall the module to be successful

Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing: python2-urllib3-1.16-1.el7.noarch 1ax 2 Installing: python2-requests-2.11.1-1.el7.noarch 2 Verifying: python2-urllib3-1.16-1.el7.noarch 1 Verifying: python2-requests-2.11.1-1.el7.noarch 2 Installed: python2-requests.noarch 01.el7 Dependency Installed 2.11.1-1.el7 Dependency Installed: python2 -urllib3.noarch 0vl 1.16-1.el7 Complete!

Then pack it through rpmbuild, and there will be no problem.

The above is the solution to the cannot import name integer_types error caused by the openstack nova compilation or packaging rpm shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report