Repository: spyder-ide/spyder

Issue:
UMR message is still printed for the Windows installer
### What steps will reproduce the problem?

<!--- You can use Markdown here --->

I constantly receive this message while running a file, even though my spyder is updated (5.0.1). I use python 3.8 on windows 7.

Reloaded modules: jupyter_client.session, zmq.eventloop, zmq.eventloop.ioloop, tornado.platform, tornado.platform.asyncio, tornado.gen, zmq.eventloop.zmqstream, jupyter_client.jsonutil, jupyter_client.adapter, spyder, spyder.pil_patch, PIL, PIL._version, PIL.Image, PIL.ImageMode, PIL.TiffTags, PIL._binary, PIL._util, PIL._imaging, cffi, cffi.api, cffi.lock, cffi.error, cffi.model

Thanks in advance for your help


Discussion:
Hey @niloofarzg, thanks for reporting. How did you install Spyder?
> 
> 
> Hey @niloofarzg, thanks for reporting. How did you install Spyder?

Hi  @ccordoba12 
I used this link to download:
https://github.com/spyder-ide/spyder/releases/download/v5.0.1/Spyder_64bit_full.exe
But our installer comes with Python 3.7, not 3.8. Do you also have another Python installation with version 3.8?
> 
> 
> But our installer comes with Python 3.7, not 3.8. Do you also have another Python installation with version 3.8?

No, I don't.
But before installing spyder5, installed Anaconda3
Ok, no problem, I was a bit confused by your initial statement.

What directory you installed Spyder to?
> 
> 
> Ok, no problem, I was a bit confused by your initial statement.
> 
> What directory you installed Spyder to?

Sorry, I'm totally a beginner at programming in spyder for python, what is a directory? I suppose you mean where I installed it. So, the answer is on drive C (C:\Users\nilotus\.spyder-py3)
Yes, that's what I meant. Thanks a lot for your help!

To deactivate this message for now, please go to the menu

    Tools > Preferences > Python interpreter

and disable the option `Enable UMR`.
@dalthviz, could you check if you're able to reproduce this problem?
One last thing @niloofarzg, please run these commands in the IPython console and paste the output of the last one here:

```python
import spyder_kernels
spyder_kernels.__file__
```
> 
> 
> One last thing @niloofarzg, please run these commands in the IPython console and paste the output of the last one here:
> 
> ```python
> import spyder_kernels
> spyder_kernels.__file__
> ```

I disabled UMR and imported what you said, the output is:
'C:\\Program Files\\Spyder\\pkgs\\spyder_kernels\\__init__.py'

I still get this: 
Reloaded modules: jupyter_client.session, zmq.eventloop, zmq.eventloop.ioloop, tornado.platform, tornado.platform.asyncio, tornado.gen, zmq.eventloop.zmqstream, jupyter_client.jsonutil, jupyter_client.adapter, spyder, spyder.pil_patch, PIL, PIL._version, PIL.Image, PIL.ImageMode, PIL.TiffTags, PIL._binary, PIL._util, PIL._imaging, cffi, cffi.api, cffi.lock, cffi.error, cffi.model
> 
> 
> One last thing @niloofarzg, please run these commands in the IPython console and paste the output of the last one here:
> 
> ```python
> import spyder_kernels
> spyder_kernels.__file__
> ```

@ccordoba12 The problem is now solved; cheers! :)
Great! I'm really glad you managed to solve it.
@ccordoba12  I was able to reproduce this (I have to either uncheck the `Enable UMR` or the option `Show reloaded modules list`).
Ok, I don't understand why the regexp you added is not working in this case:

https://github.com/spyder-ide/spyder-kernels/blob/master/spyder_kernels/customize/utils.py#L71

but since this is not critical, I tagged it for 5.0.3
> Ok, I don't understand why the regexp you added is not working in this case

Perhaps it's because we also need to check for `.*\pkgs\.*`

Resolving patch:
diff --git a/external-deps/spyder-kernels/spyder_kernels/customize/utils.py b/external-deps/spyder-kernels/spyder_kernels/customize/utils.py
--- a/external-deps/spyder-kernels/spyder_kernels/customize/utils.py
+++ b/external-deps/spyder-kernels/spyder_kernels/customize/utils.py
@@ -68,7 +68,7 @@ def path_is_library(path, initial_pathlist=None):
         # library or installed to site-packages.
         return True
     elif os.name == 'nt':
-        if re.search(r'.*/pkgs/.*', path):
+        if re.search(r'.*\\pkgs\\.*', path):
             return True
         else:
             return False


Test patch: