Python Forum
ImportError has not raised in pkg_resources module but expected
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ImportError has not raised in pkg_resources module but expected
#1
I tried to use pkg_resources module in rbtools but I got exception as No module named _imp.

In python 2.7.15rc1 (/usr/lib/python2.7/dist-packages/pkg_resources), we handled if _imp module is not found then we are importing "imp as _imp" in except block.

try:
import _imp
except ImportError:
# Python 3.2 compatibility
import imp as _imp


Here the issue is, try block doesn't raise exception and not handled in except block to set it from imp module.

Please help to resolve this issue. Thanks in advance!

OS: Ubuntu 18.04
Reply
#2
No module named _imp is not an exception, it is an error message. Please post the whole exception traceback.
Reply
#3
No module named _imp
*** failed to import extension reviewboard from /home/mercurial-reviewboard-stage: name 'SyncTransport' is not defined

I'm expecting try block should raise if it is not found

But when I try it in console it is raising
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,309 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ImportError: No module named PIL rudeoil18 9 6,586 Mar-03-2022, 01:25 PM
Last Post: snippsat
  RuntimeError: generator raised StopIteration quest 1 5,750 Mar-28-2021, 08:11 PM
Last Post: quest
  ImportError: No module named coltson 3 3,441 Nov-21-2020, 10:22 AM
Last Post: Superjoe
  ImportError: No module named pydrive.auth lknights1987 5 5,841 Jun-23-2020, 06:40 PM
Last Post: snippsat
  ImportError: No module named tkinter. kouadio 1 3,600 Oct-08-2019, 10:59 PM
Last Post: Larz60+
  ImportError: No module named xlrd dhiliptcs 5 17,386 Sep-21-2019, 12:17 PM
Last Post: brighteningeyes
  multi-line messages in raised exceptions? Skaperen 3 7,221 Aug-01-2019, 02:17 AM
Last Post: Skaperen
  TimeLapse Help - ImportError: No module named 'sh' evvvonder 4 4,333 Jun-28-2019, 10:52 PM
Last Post: evvvonder
  ImportError: No module named pymysql - On Apache2 for Python 2.7 on Mac Tyrone 9 7,501 Jun-12-2019, 07:08 PM
Last Post: Tyrone

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020