shikharp:

using python instead of ipython worked


A little side note for those who are interested why. If conda custom virtualenv doesn’t have ipython package installed, when you fire up ipython from within your custom env it will silently use ipython from conda base environment and base python runtime for this instance of ipython. So, if your base doesn’t have pytorch installed the import error occured.