Code Sample, a copy-pastable example if possible

>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/hanan/anaconda3/lib/python3.6/site-packages/pandas/__init__.py", line 59, in <module>
    from pandas.util._tester import test
  File "/home/hanan/anaconda3/lib/python3.6/site-packages/pandas/util/_tester.py", line 11, in <module>
    import pytest
  File "/home/hanan/anaconda3/lib/python3.6/site-packages/pytest.py", line 27, in <module>
    _preloadplugins() # to populate pytest.* namespace so help(pytest) works
  File "/home/hanan/anaconda3/lib/python3.6/site-packages/_pytest/config.py", line 109, in _preloadplugins
    _preinit.append(get_config())
  File "/home/hanan/anaconda3/lib/python3.6/site-packages/_pytest/config.py", line 118, in get_config
    pluginmanager.import_plugin(spec)
  File "/home/hanan/anaconda3/lib/python3.6/site-packages/_pytest/config.py", line 426, in import_plugin
    __import__(importspec)
  File "/home/hanan/anaconda3/lib/python3.6/site-packages/_pytest/debugging.py", line 3, in <module>
    import pdb
  File "/home/hanan/anaconda3/lib/python3.6/pdb.py", line 136, in <module>
    class Pdb(bdb.Bdb, cmd.Cmd):
AttributeError: module 'cmd' has no attribute 'Cmd'

Problem description

import fails on a clean install of anaconda

Expected Output

import success silently

Output of pd.show_versions()

# Paste the output here pd.show_versions() here import fails, instead I grep pandas from `conda list` pandas 0.20.1 np112py36_0

Comment From: TomAugspurger

What's your OS, anaconda version, and how'd you create the environment and install pandas?

Do you have pytest installed in that environment?

Comment From: chananshgong

After closing the terminal and reopen it problems solved (ubuntu 16.04)

Comment From: TomAugspurger

Huh, not sure why that would be, but glad to hear it's working.