1

When I am trying to run the spyder (Anaconda) I am getting the following Error:

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\spyder-script.py", line 10, in 
sys.exit(main())
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\start.py", line 205, in main
mainwindow.main()
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3651, in main
mainwindow = run_spyder(app, options, args)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3526, in run_spyder
main.setup()
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 945, in setup
from spyder.plugins.ipythonconsole.plugin import IPythonConsole
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\plugin.py", line 46, in 
from spyder.plugins.ipythonconsole.widgets import (ClientWidget,
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\__init__.py", line 16, in 
from .debugging import DebuggingWidget
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\debugging.py", line 13, in 
import pdb
File "C:\ProgramData\Anaconda3\lib\pdb.py", line 138, in 
class Pdb(bdb.Bdb, cmd.Cmd):
AttributeError: module 'cmd' has no attribute 'Cmd'

Can someone please health me to resolve this issue?

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53
RAMA
  • 13
  • 4

2 Answers2

0

I have created a file with the name cmd.py. After deleting the file (or rename the file), my problem got solved.

RAMA
  • 13
  • 4
0

Do you happen to have a file named cmd.py in the same directory as the file you are trying to execute? Cause If you are, then import cmd would not import the right python module. Instead, it would import your created "cmd.py" file.

I too faced this issue cause I had a file named "cmd.py" along with my python scripts and it would import that whenever I said import cmd. Renaming it helped me solve the issue

Sahil_Angra
  • 131
  • 7