fix misleading error message

Failing to install a dependency which is a simple string (and not a
Dependency object) yields the strange error "str object has no attribute
name". This has now been resolved.