Import torch not working

username: MarcAndrew_Laurenvil
cooked: <p>Hi, I’m an artist, not a programmer, and I’m trying to install pytorch to install a neural network style transfer software, following this guide <a href="https://github.com/ProGamerGov/neural-style-pt/blob/master/INSTALL.md" rel="nofollow noopener">https://github.com/ProGamerGov/neural-style-pt/blob/master/INSTALL.md</a> , but when I reach the step right after pytorch is installed (with it saying everything installed properly) when I try to run the next command which is<br>
python models/download_models.py          it just gives me an error and says that the torch module can not be imported because it does not exist</p>
<p>I have python 3.8.6 installed and I used the anaconda command without Cuda for installing pytorch</p>

username: ptrblck
cooked: <p>CC <a class="mention" href="/u/progamergov">@ProGamerGov</a> as the repo author <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>

username: ProGamerGov
cooked: <p><a class="mention" href="/u/marcandrew_laurenvil">@MarcAndrew_Laurenvil</a> I myself don’t have Anaconda setup (I use pip and Python installed normally), but it sounds like you are having an issue with installing PyTorch and making it work with Anaconda as there’s no neural-style-pt specific errors. The line <code>import torch</code> is a default PyTorch import. <a class="mention" href="/u/ptrblck">@ptrblck</a> May be able to point you in a better direction for Anaconda/PyTorch support.</p>
<p>I did a quick search, and found these links that might be useful for helping resolve the issue. They vary from Anaconda environment issues to incompatible Python versions:</p>
<aside class="onebox stackexchange">
  <header class="source">
      <a href="https://stackoverflow.com/questions/58732358/no-module-named-torch-but-installed-pytorch-1-3-0-with-conda-in-ubuntu-18-04" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>
  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/2315094/user2315094" target="_blank" rel="noopener nofollow ugc">
    <img alt="user2315094" src="https://www.gravatar.com/avatar/7dbc931c7f9da91b1aca5f461d25edb0?s=128&amp;d=identicon&amp;r=PG" class="thumbnail onebox-avatar" width="128" height="128">
  </a>
<h4>
  <a href="https://stackoverflow.com/questions/58732358/no-module-named-torch-but-installed-pytorch-1-3-0-with-conda-in-ubuntu-18-04" target="_blank" rel="noopener nofollow ugc">"no module named torch". But installed pytorch 1.3.0 with conda in Ubuntu 18.04.02 Server Edition</a>
</h4>

<div class="tags">
  <strong>python-3.x, module, pytorch, conda</strong>
</div>

<div class="date">
  asked by
  
  <a href="https://stackoverflow.com/users/2315094/user2315094" target="_blank" rel="noopener nofollow ugc">
    user2315094
  </a>
  on <a href="https://stackoverflow.com/questions/58732358/no-module-named-torch-but-installed-pytorch-1-3-0-with-conda-in-ubuntu-18-04" target="_blank" rel="noopener nofollow ugc">02:27PM - 06 Nov 19 UTC</a>
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
<br>
<aside class="onebox stackexchange">
  <header class="source">
      <a href="https://stackoverflow.com/questions/57233958/how-is-it-that-torch-is-not-installed-by-torchvision" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>
  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/1601580/charlie-parker" target="_blank" rel="noopener nofollow ugc">
    <img alt="Charlie Parker" src="https://i.stack.imgur.com/2B6rV.png?s=128&amp;g=1" class="thumbnail onebox-avatar" width="128" height="128">
  </a>
<h4>
  <a href="https://stackoverflow.com/questions/57233958/how-is-it-that-torch-is-not-installed-by-torchvision" target="_blank" rel="noopener nofollow ugc">How is it that torch is not installed by torchvision?</a>
</h4>

<div class="tags">
  <strong>python, pytorch, conda</strong>
</div>

<div class="date">
  asked by
  
  <a href="https://stackoverflow.com/users/1601580/charlie-parker" target="_blank" rel="noopener nofollow ugc">
    Charlie Parker
  </a>
  on <a href="https://stackoverflow.com/questions/57233958/how-is-it-that-torch-is-not-installed-by-torchvision" target="_blank" rel="noopener nofollow ugc">04:19PM - 27 Jul 19 UTC</a>
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
<br>
<aside class="onebox stackexchange">
  <header class="source">
      <a href="https://stackoverflow.com/questions/45906706/pytorch-install-with-anaconda-error" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>
  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/8081595/econ" target="_blank" rel="noopener nofollow ugc">
    <img alt="econ" src="https://www.gravatar.com/avatar/48f612dda5803c8d1dd783462feb9b30?s=128&amp;d=identicon&amp;r=PG&amp;f=1" class="thumbnail onebox-avatar" width="128" height="128">
  </a>
<h4>
  <a href="https://stackoverflow.com/questions/45906706/pytorch-install-with-anaconda-error" target="_blank" rel="noopener nofollow ugc">Pytorch install with anaconda error</a>
</h4>

<div class="tags">
  <strong>anaconda, pytorch</strong>
</div>

<div class="date">
  asked by
  
  <a href="https://stackoverflow.com/users/8081595/econ" target="_blank" rel="noopener nofollow ugc">
    econ
  </a>
  on <a href="https://stackoverflow.com/questions/45906706/pytorch-install-with-anaconda-error" target="_blank" rel="noopener nofollow ugc">03:44PM - 27 Aug 17 UTC</a>
</div>

  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>
<br>
<aside class="onebox allowlistedgeneric">
  <header class="source">
      <img src="https://www.redditstatic.com/desktop2x/img/favicon/android-icon-192x192.png" class="site-icon" width="192" height="192">
      <a href="https://www.reddit.com/r/pytorch/comments/f3iali/downloaded_anaconda_but_cant_install_pytorch/" target="_blank" rel="noopener nofollow ugc">reddit</a>
  </header>
  <article class="onebox-body">
    <img src="" class="thumbnail" width="" height="">

<h3><a href="https://www.reddit.com/r/pytorch/comments/f3iali/downloaded_anaconda_but_cant_install_pytorch/" target="_blank" rel="noopener nofollow ugc">r/pytorch - Downloaded Anaconda but can't install PyTorch</a></h3>

<p>0 votes and 2 comments so far on Reddit</p>


  </article>
  <div class="onebox-metadata">
    
    
  </div>
  <div style="clear: both"></div>
</aside>


username: MarcAndrew_Laurenvil
cooked: <p>Thank you so much for replying! I’ve been trying to set up neural style for months using the GUI version here <a href="https://github.com/cameronleger/neural-style-gui" rel="noopener nofollow ugc">https://github.com/cameronleger/neural-style-gui</a>. But I’m on Windows so this only works with your pytorch version of neural style, I tried every possible windows based method of installation and I still can’t get it to work, when I try running get-pip.py to install pip for example, it goes through the installation successfully, and I even added the python scripts folder to my windows path, but when I then turn around and type pip-V it says pip is not recognized as a command, Is there a different way to install pip, or something that I’m missing, I don’t think theres anyway I would be able to figure out the Anaconda method of installation on my own</p>

username: ProGamerGov
cooked: <p><a class="mention" href="/u/marcandrew_laurenvil">@MarcAndrew_Laurenvil</a></p>
<p>For my own Windows computer, I installed Python from the official site (remember to click the option to add Python to your windows path or whatever it’s called when installing): <a href="https://www.python.org/downloads/windows/" rel="noopener nofollow ugc">https://www.python.org/downloads/windows/</a></p>
<p>I’m not sure if all the versions of Python available work with PyTorch, but <a class="mention" href="/u/ptrblck">@ptrblck</a> may know.</p>
<p>After installing Python, I get the PyTorch install command by selecting pip instead of Conda, Windows, Python, and Cuda 10.2 from the official site here: <a href="https://pytorch.org/" rel="noopener nofollow ugc">https://pytorch.org/</a></p>
<p>I then download repositories like neural-style-pt as a zip, unzip and open the folder, then I copy the file path to cmd after the cd command. Since you’re new to this sort of thing, always try to make sure that commands have the proper spacing as well.</p>
<p>I’ve never run into any issues installing PyTorch and using it this way. Hopefully it’ll work for you as well!</p>

username: ProGamerGov
cooked: <p>If you run into an issue with the GUI program, you’ll have to ask cameronleger here: <a href="https://github.com/cameronleger/neural-style-gui/issues" rel="noopener nofollow ugc">https://github.com/cameronleger/neural-style-gui/issues</a> as he’s the one who made it.</p>

username: ptrblck
cooked: <p>The support for Python3.5 was recently removed, if I’m not mistaken, so 3.6 should be the minimal version (3.7 and 3.8 are supported as well).</p>