can't import torch mac
I'm trying to import torch and I'm getting the next problem:

Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/torch/__init__.py", line 66, in &lt;module&gt;
    import torch._dl as _dl_flags
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/torch/_dl.so, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/torch/_dl.so: mach-o, but wrong architecture
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/torch/_dl.so: mach-o, but wrong architecture


someone knows how can I solve this?
Thanks:)

Try like that:

mkdir test_torch
cd test_torch
python3 -m venv .venv
source .venv/bin/activate
pip install torch torchvision
python3

&gt;&gt;&gt; import torch


Works for me. MacOS 10.13.4, Python 3.6.4

Or like that:

mkdir test_torch
cd test_torch
virtualenv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install torch torchvision
python2

&gt;&gt;&gt; import torch


Works for me. MacOS 10.13.4, Python 2.7.10

If you don't need to use torch then you can install only torchvision

pip install --no-deps torchvision

