Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
module inspect error
#1
Hi,

I am running python on Ubuntu 18, I have following errors when I run import inspect, appreciate any tips to fix the problem. thank you

Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2

>>> import inspect
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/inspect.py", line 42, in <module>
from collections import namedtuple
File "/usr/lib/python2.7/collections.py", line 22, in <module>
from keyword import iskeyword as _iskeyword
File "keyword.py", line 3, in <module>
from inspect import currentframe, getframeinfo
ImportError: cannot import name currentframe
Reply
#2
Do you possibly have your own file named keyword.py which is masking the real one the module is trying to import?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Inspecting without using inspect deanhystad 3 1,612 Nov-11-2021, 07:17 PM
Last Post: snippsat
  vlc module error pythonprogrammer 1 2,893 Apr-23-2020, 04:16 AM
Last Post: Larz60+
  Inspect.getmembers with isclass returns an empty list Aldar 1 2,806 Oct-02-2019, 01:48 PM
Last Post: Aldar
  pyhton error there is no PIL module error help! pokeboss235 1 2,935 Feb-22-2018, 03:03 AM
Last Post: Larz60+
  How to inspect the code of __exit__ method used with 'with' statement? sonicblind 3 3,401 Oct-18-2017, 01:51 PM
Last Post: sonicblind

Forum Jump:

User Panel Messages

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