ImportError: No module named 'torch' [closed]

asked 2019-10-18 11:16:57 -0500

Kora11101 gravatar image

updated 2019-10-21 03:39:11 -0500


After writing a command "python3" to run a script, I have an error:

Traceback (most recent call last):
  File "", line 1, in <module>
    import torch
ImportError: No module named 'torch'

I have installed PyTorch. What can be the reason for this problem?

Thanks a lot!

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see for more details. by stevemacenski
close date 2019-10-18 14:54:34.715366



I'm confused as to how this related to ROS.

You tagged kinetic meaning you're probably on 16.04. Is pytorch installed systemwide for python 2 or python 3? Or have you been using virtualenvs? What is the variable $PYTHONPATH set to?

Jari gravatar image Jari  ( 2019-10-18 12:04:27 -0500 )edit