So, the error message is a result of the following evaluating to false, in the C code, I think:
inline bool THPVariable_Check(PyObject *obj)
{
  return THPVariableClass && PyObject_IsInstance(obj, THPVariableClass);
}

(python_variable.h)
So, seems like it’s not checking some attribute, but looking at the actual class.
The type of the class is being obtained, in the C code like:
  if (PyType_Ready(&THPVariableType) < 0)
    return false;
  Py_INCREF(&THPVariableType);
  PyModule_AddObject(module, "_VariableBase", (PyObject *)&THPVariableType);

(python_variable.cpp)
Then, that _VariableBase bit seems to be defined on the C side. from variable.py:
class Variable(_C._VariableBase):
… though I’m not sure where the breadcrumbs lead after this…
grep -ir '_VariableBase' torch
torch/autograd/variable.py:class Variable(_C._VariableBase):
torch/csrc/autograd/python_variable.cpp:  "torch._C._VariableBase",              /* tp_name */
torch/csrc/autograd/python_variable.cpp:  PyModule_AddObject(module, "_VariableBase", (PyObject *)&THPVariableType);

However, as others point out, I think reinstalling via conda would be a good place to start. conda provides binaries, unlike pip, which provides source code.