Cannot retrieve author in sidebar of single.php

Test whether on a single post. If so, get a user object by the current posts’ author ID and echo its display_name property:

if ( is_single() ) {
    global $post;

    $author = get_userdata( $post->post_author );
    echo $author->display_name;
}

tech