ModuleNotFoundError in  in_interactive_session
State: closed

- [x] closes #24690
- [na] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=h1) Report
> Merging [#24714](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/bad02e8875e11e03d438d66e38785203549a0b87?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `50%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24714/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24714      +/-   ##
==========================================
- Coverage   92.38%   92.38%   -0.01%     
==========================================
  Files         166      166              
  Lines       52311    52324      +13     
==========================================
+ Hits        48328    48338      +10     
- Misses       3983     3986       +3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.8% <50%> (-0.01%)` | :arrow_down: |
| #single | `43.06% <50%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/formats/console.py](https://codecov.io/gh/pandas-dev/pandas/pull/24714/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvY29uc29sZS5weQ==) | `72.46% <50%> (-1.78%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/24714/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `88% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/24714/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `97.75% <0%> (+0.03%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=footer). Last update [bad02e8...d675cd2](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=h1) Report
> Merging [#24714](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/3fe28fcb6f4292e7d6c01ea78d6a2a21b0bac16a?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `50%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/24714/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #24714      +/-   ##
==========================================
- Coverage   92.38%   92.38%   -0.01%     
==========================================
  Files         166      166              
  Lines       52321    52324       +3     
==========================================
+ Hits        48338    48339       +1     
- Misses       3983     3985       +2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.8% <50%> (-0.01%)` | :arrow_down: |
| #single | `43.06% <50%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/formats/console.py](https://codecov.io/gh/pandas-dev/pandas/pull/24714/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvY29uc29sZS5weQ==) | `72.46% <50%> (-1.78%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=footer). Last update [3fe28fc...9f8a50e](https://codecov.io/gh/pandas-dev/pandas/pull/24714?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@rejack, remove the note
thanks!
Hmm I still wasn't sure we should merge this. Can we check with upstream to
see if their workaround can be applied for py2 only?

Or can we add a TODO to remove this when we drop Python2?

On Sun, Jan 13, 2019 at 1:17 PM Jeff Reback <notifications@github.com>
wrote:

> thanks!
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/24714#issuecomment-453857330>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHItXs_RGnK_SmfJFGyA1DImwWHaWrks5vC4ZWgaJpZM4Z6WTF>
> .
>

Not sure I understand. The pylint issue is affecting both py2 and py3 I think. Or why do you think there’s a difference?

> On 13 Jan 2019, at 19:23, Tom Augspurger <notifications@github.com> wrote:
> 
> Hmm I still wasn't sure we should merge this. Can we check with upstream to
> see if their workaround can be applied for py2 only?
> 
> Or can we add a TODO to remove this when we drop Python2?
> 
> On Sun, Jan 13, 2019 at 1:17 PM Jeff Reback <notifications@github.com>
> wrote:
> 
> > thanks!
> >
> > —
> > You are receiving this because you commented.
> > Reply to this email directly, view it on GitHub
> > <https://github.com/pandas-dev/pandas/pull/24714#issuecomment-453857330>,
> > or mute the thread
> > <https://github.com/notifications/unsubscribe-auth/ABQHItXs_RGnK_SmfJFGyA1DImwWHaWrks5vC4ZWgaJpZM4Z6WTF>
> > .
> >
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.

From the linked bug report in
https://github.com/PyCQA/pylint/blob/master/pylint/lint.py#L153 to
https://bugs.python.org/issue10845,
it seems to be fixed in python 3.2. So it's possible that pylint could
apply that mock only for Python <=2.7

On Sun, Jan 13, 2019 at 1:30 PM Nicolas Dickreuter <notifications@github.com>
wrote:

> Not sure I understand. The pylint issue is affecting both py2 and py3 I
> think. Or why do you think there’s a difference?
>
> > On 13 Jan 2019, at 19:23, Tom Augspurger <notifications@github.com>
> wrote:
> >
> > Hmm I still wasn't sure we should merge this. Can we check with upstream
> to
> > see if their workaround can be applied for py2 only?
> >
> > Or can we add a TODO to remove this when we drop Python2?
> >
> > On Sun, Jan 13, 2019 at 1:17 PM Jeff Reback <notifications@github.com>
> > wrote:
> >
> > > thanks!
> > >
> > > —
> > > You are receiving this because you commented.
> > > Reply to this email directly, view it on GitHub
> > > <
> https://github.com/pandas-dev/pandas/pull/24714#issuecomment-453857330>,
> > > or mute the thread
> > > <
> https://github.com/notifications/unsubscribe-auth/ABQHItXs_RGnK_SmfJFGyA1DImwWHaWrks5vC4ZWgaJpZM4Z6WTF
> >
> > > .
> > >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub, or mute the thread.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/24714#issuecomment-453858244>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABQHIg2btBiGKv--kIUFnYfsh6Uie6Hxks5vC4lJgaJpZM4Z6WTF>
> .
>

I see. I have submitted a PR for Pylint as well to remove the mock, but
their release cycle is very slow.

On Sun, 13 Jan 2019 at 19:44, Tom Augspurger <notifications@github.com>
wrote:

> From the linked bug report in
> https://github.com/PyCQA/pylint/blob/master/pylint/lint.py#L153 to
> https://bugs.python.org/issue10845,
> it seems to be fixed in python 3.2. So it's possible that pylint could
> apply that mock only for Python <=2.7
>
> On Sun, Jan 13, 2019 at 1:30 PM Nicolas Dickreuter <
> notifications@github.com>
> wrote:
>
> > Not sure I understand. The pylint issue is affecting both py2 and py3 I
> > think. Or why do you think there’s a difference?
> >
> > > On 13 Jan 2019, at 19:23, Tom Augspurger <notifications@github.com>
> > wrote:
> > >
> > > Hmm I still wasn't sure we should merge this. Can we check with
> upstream
> > to
> > > see if their workaround can be applied for py2 only?
> > >
> > > Or can we add a TODO to remove this when we drop Python2?
> > >
> > > On Sun, Jan 13, 2019 at 1:17 PM Jeff Reback <notifications@github.com>
> > > wrote:
> > >
> > > > thanks!
> > > >
> > > > —
> > > > You are receiving this because you commented.
> > > > Reply to this email directly, view it on GitHub
> > > > <
> > https://github.com/pandas-dev/pandas/pull/24714#issuecomment-453857330>,
> > > > or mute the thread
> > > > <
> >
> https://github.com/notifications/unsubscribe-auth/ABQHItXs_RGnK_SmfJFGyA1DImwWHaWrks5vC4ZWgaJpZM4Z6WTF
> > >
> > > > .
> > > >
> > > —
> > > You are receiving this because you authored the thread.
> > > Reply to this email directly, view it on GitHub, or mute the thread.
> >
> > —
> > You are receiving this because you commented.
> > Reply to this email directly, view it on GitHub
> > <https://github.com/pandas-dev/pandas/pull/24714#issuecomment-453858244
> >,
> > or mute the thread
> > <
> https://github.com/notifications/unsubscribe-auth/ABQHIg2btBiGKv--kIUFnYfsh6Uie6Hxks5vC4lJgaJpZM4Z6WTF
> >
> > .
> >
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/24714#issuecomment-453859294>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABMrfjPrSFnwBJeIfI03VsFGSQp-tno4ks5vC4yOgaJpZM4Z6WTF>
> .
>