3

# Cannot divide a vector by zero

Package:

sympy

8356

Exception Class:

ValueError

## Raise code

```
def _div_helper(one, other):
""" Helper for division involving vectors. """
if isinstance(one, Vector) and isinstance(other, Vector):
raise TypeError("Cannot divide two vectors")
elif isinstance(one, Vector):
if other == S.Zero:
raise ValueError("Cannot divide a vector by zero")
return VectorMul(one, Pow(other, S.NegativeOne))
else:
raise TypeError("Invalid division involving a vector")
class BaseVector(Vector, AtomicExpr):
""" """
```

## Links to the raise (1)

https://github.com/sympy/sympy/blob/2c83657ff1c62fc2761b639469fdac7f7561a72a/sympy/vector/vector.py#L338NO FIXES YET

Just press the button and we will add solution

to this exception as soon as possible

* As many users press the button, the faster we create a fix

### Add a possible fix

Please authorize to post fix