Repository: conan-io/conan

Issue:
[question] RuntimeWarning while using python_requires
In Conan 1.8,

I am getting RuntimeWarning while using python_requires:
```
conan export . demo/test
/home/sun/.conan/data/MyBase/1.7/demo/test/export/conanfile.py:1: RuntimeWarning: Parent module 'MyBase/1' not found while handling absolute import
  from conans import ConanFile, CMake, tools
/home/sun/.conan/data/MyBase/1.7/demo/test/export/conanfile.py:2: RuntimeWarning: Parent module 'MyBase/1' not found while handling absolute import
  import os,sys

..
..
```

My base conan file is:
```
from conans import ConanFile, CMake, tools
import os,sys,

_scm = {
    "type"      : "git",
    "url"       : "auto",
    "revision"  : "auto"
}

class MyBase(ConanFile):

..
..
```


To help us debug your issue please explain:

- [x] I've read the [CONTRIBUTING guide](https://raw.githubusercontent.com/conan-io/conan/develop/.github/CONTRIBUTING.md).
- [x] I've specified the Conan version, operating system version and any tool that can be relevant.
- [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.




Discussion:
Hi @sunj1 

Could you please share the consumer conanfile.py too? So we can reproduce. Thanks!
Consumer conanfile:
```
from conans import python_requires

base = python_requires("MyBase/1.7@demo/test")

class MyConanFile(base.MyBase):
..
..
..
```

Verified. This warning is only output in Python27, not in Python3
Thanks for the information @memsharded .
I found the below details on https://stackoverflow.com/questions/2267984/dynamic-class-loading-in-python-2-6-runtimewarning-parent-module-plugins-not
- The problem here is with the dot ('.') in the module name
-  Python then thinks it's a module path

Warning was not printed when I removed dot from the version of my base package.
Not sure why it started appearing in Conan 1.8

Resolving patch:
diff --git a/conans/client/cmd/export_linter.py b/conans/client/cmd/export_linter.py
--- a/conans/client/cmd/export_linter.py
+++ b/conans/client/cmd/export_linter.py
@@ -50,8 +50,8 @@ def _runner(args):
 
 
 def _normal_linter(conanfile_path, hook):
-    args = ["--py3k", "--enable=all", "--reports=no", "--disable=no-absolute-import", "--persistent=no", 
-            "--load-plugins=conans.pylint_plugin",
+    args = ["--py3k", "--enable=all", "--reports=no", "--disable=no-absolute-import",
+            "--persistent=no", "--load-plugins=conans.pylint_plugin",
             hook, '"%s"' % conanfile_path]
     pylintrc = os.environ.get("CONAN_PYLINTRC", None)
     if pylintrc:
@@ -68,6 +68,8 @@ def _accept_message(msg):
             return False
         if symbol == "import-error" and msg.get("column") > 3:  # Import of a conan python package
             return False
+        if symbol == "no-name-in-module" and "python_requires" in msg.get("message"):
+            return False
 
         return True
 
diff --git a/conans/client/graph/python_requires.py b/conans/client/graph/python_requires.py
--- a/conans/client/graph/python_requires.py
+++ b/conans/client/graph/python_requires.py
@@ -37,7 +37,8 @@ def __call__(self, require):
             self._references.append(reference)
             try:
                 sys.path.append(os.path.dirname(path))
-                module = imp.load_source(str(r), path)
+                # replace avoid warnings in Py2 with dots
+                module = imp.load_source(str(r).replace(".", "*"), path)
             finally:
                 sys.path.pop()
             self._modules[require] = module, reference
diff --git a/conans/pylint_plugin.py b/conans/pylint_plugin.py
--- a/conans/pylint_plugin.py
+++ b/conans/pylint_plugin.py
@@ -5,7 +5,7 @@
 
 def register(linter):
     """Declare package as plugin
-    
+
     This function needs to be declared so astroid treats
     current file as a plugin.
     """


Test patch:
diff --git a/conans/test/command/export_linter_test.py b/conans/test/command/export_linter_test.py
--- a/conans/test/command/export_linter_test.py
+++ b/conans/test/command/export_linter_test.py
@@ -75,7 +75,9 @@ class BaseConan(ConanFile):
         client.run("export . conan/stable")
 
         conanfile2 = """
-from conans import ConanFile
+from conans import ConanFile, python_requires
+
+python_requires("baselib/1.0@conan/stable")
 class TestConan(ConanFile):
     name = "Hello"
     version = "1.2"