ImportError:failed to load Pytorch C extensions:It appears that Pytorch has loaded the 'torch/_C' folder of the Pytorch repository rather than the C extensions which are expected in the 'torch._C' namespace.

baikaishui35: <p>I am using Jetson agx xavier from nvida.<br>
jetpack4.4  ubuntu18.04 CUDA 10.02.<br>
Now i want to download torch into this ARM, here is how Nvida tells me to do.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/6/063b479e35ff91dc8d49dae51e85d669575fcee9.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/063b479e35ff91dc8d49dae51e85d669575fcee9" title="af4ad4f315994614250d968d3300881"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/0/6/063b479e35ff91dc8d49dae51e85d669575fcee9_2_666x500.jpeg" alt="af4ad4f315994614250d968d3300881" data-base62-sha1="T7S0zQzSetcjtCnTfi0JKD9lAR" width="666" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/0/6/063b479e35ff91dc8d49dae51e85d669575fcee9_2_666x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/0/6/063b479e35ff91dc8d49dae51e85d669575fcee9_2_999x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/0/6/063b479e35ff91dc8d49dae51e85d669575fcee9_2_1332x1000.jpeg 2x" data-dominant-color="A3A4A6"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">af4ad4f315994614250d968d3300881</span><span class="informations">2016×1512 921 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
But my internet can not do the first step ,i can not wget <a href="https://nvida.box.com" rel="noopener nofollow ugc">https://nvida.box.com</a>.<br>
So i download it by chrom, then pip install and import it into pycharm.<br>
Then i see this error, it has bother me for a half month.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/a/1ab6eb60f30743db9751cee33121db86b9e81eae.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/1ab6eb60f30743db9751cee33121db86b9e81eae" title="微信图片_20210728105409"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/1/a/1ab6eb60f30743db9751cee33121db86b9e81eae_2_666x500.jpeg" alt="微信图片_20210728105409" data-base62-sha1="3OkjFRqi0LPrONHWIlNaM0V0lEq" width="666" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/1/a/1ab6eb60f30743db9751cee33121db86b9e81eae_2_666x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/1/a/1ab6eb60f30743db9751cee33121db86b9e81eae_2_999x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/1/a/1ab6eb60f30743db9751cee33121db86b9e81eae_2_1332x1000.jpeg 2x" data-dominant-color="635F63"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">微信图片_20210728105409</span><span class="informations">4032×3024 2.74 MB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>ImportError:failed to load Pytorch C extensions:It appears that Pytorch has loaded the ‘torch/_C’ folder of the Pytorch repository rather than the C extensions which are expected in the ‘torch._C’ namespace.This can occur when using the ‘install’ workflow.<br>
$ pthon setup.py install &amp;&amp; python -c “import torch”<br>
This error can generally be solved using the ‘develop’ work flow<br>
$ python setup.py develop &amp;&amp;python -c “import torch” <span class="hashtag-raw">#This</span> should succeed or by running Python from a different directory.</p>
<p>I find this error from the <strong>init</strong>.file:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/0/f0e95158ff09f625ba9a43fddd1f0347b25b618f.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/f0e95158ff09f625ba9a43fddd1f0347b25b618f" title="微信图片_20210728105424"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/0/f0e95158ff09f625ba9a43fddd1f0347b25b618f_2_666x500.jpeg" alt="微信图片_20210728105424" data-base62-sha1="ynctnIxSeiAqJN1k0Dhktaiwo8v" width="666" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/0/f0e95158ff09f625ba9a43fddd1f0347b25b618f_2_666x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/f/0/f0e95158ff09f625ba9a43fddd1f0347b25b618f_2_999x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/f/0/f0e95158ff09f625ba9a43fddd1f0347b25b618f_2_1332x1000.jpeg 2x" data-dominant-color="77797E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">微信图片_20210728105424</span><span class="informations">3064×2298 1.33 MB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
My anaconda is python3.7, then i see this and change it to python3.6. And then i see this error:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/0/f08f53fdaa961477016fb33a7bbe51e7de206780.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/f08f53fdaa961477016fb33a7bbe51e7de206780" title="微信图片_20210728105437"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/0/f08f53fdaa961477016fb33a7bbe51e7de206780_2_666x500.jpeg" alt="微信图片_20210728105437" data-base62-sha1="yk5FES4UgSf6cvyrrmrWpwHIw5W" width="666" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/0/f08f53fdaa961477016fb33a7bbe51e7de206780_2_666x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/f/0/f08f53fdaa961477016fb33a7bbe51e7de206780_2_999x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/f/0/f08f53fdaa961477016fb33a7bbe51e7de206780_2_1332x1000.jpeg 2x" data-dominant-color="696A6C"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">微信图片_20210728105437</span><span class="informations">4032×3024 2.79 MB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>The both error bothered me for a long time, i really hope someone to save me. <img src="https://discuss.pytorch.org/images/emoji/apple/sob.png?v=12" title=":sob:" class="emoji" alt=":sob:" loading="lazy" width="20" height="20"> <img src="https://discuss.pytorch.org/images/emoji/apple/sob.png?v=12" title=":sob:" class="emoji" alt=":sob:" loading="lazy" width="20" height="20"> <img src="https://discuss.pytorch.org/images/emoji/apple/sob.png?v=12" title=":sob:" class="emoji" alt=":sob:" loading="lazy" width="20" height="20"></p>

RingoSong: <p>hello, I meet the same question,and i want to ask do you slove this bug?</p>

sanjaythakur: <p>I realized for me it was because I ran commands from a directory which had a folder named torch. It worked fine from other directories.</p>