1

My intention is to import a .py module that is passed as an argument:

module = str(sys.argv[3])
mymod = __import__(module)

However, I run into "ImportError: Import by filename is not supported.". Note that the passed module name is different on different invocation, and there is no common file path. What would be the workaround?

  • [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) detected. Why do you want to do this? – Kevin Apr 01 '15 at 12:08
  • In any case, [works on my machine](http://i.stack.imgur.com/jHzbf.png). Maybe the problem is in the part of the code you haven't shown us. – Kevin Apr 01 '15 at 12:14

0 Answers0