Lo aprendà de un amigo is probably the best direct translation. I'm not sure if you can use por in place of de. That would be the most direct translation, but it sounds wrong to me. A native speaker will he you here.
Consider saying un amigo me dijo instead. It sounds more Spanish to me.
Come to think about it, you can say lo supe de un amigo too.
You used the imperfect aprendÃa would translate as I used to learn it from..., and this usage is unusual.
__________________
Me ayuda si corrige mis errores. Gracias.
|