Tuhura Otago Museum welcomed special guest Heidemarie Stefanyshyn-Piper for its "Out of This World" event on Saturday.
Mrs Stefanyshyn-Piper’s career has spanned over 13 years, from launching and landing spaceships to conducting maintenance on the International Space Station.
The event consisted of an interactive space science show, free shows in the museum’s Perpetual Guardian Planetarium and a question and answer session with Mrs Stefanyshyn-Piper.
US ambassador Tom Udall said the need for a diverse, talented workforce in Stem-related fields (science, technology, engineering and maths) had never been more necessary.
"We’re delighted to work with the museum to bring an astronaut to Dunedin.
"Absolutely consider a space-related career.
"Be encouraged that there are so many opportunities for anyone with a desire to learn — with any skill set or background."
Mrs Stefanyshyn-Piper was the first woman to be the lead spacewalker on a shuttle flight and had spent a total of 27 days in space across two flights.
She had gone from underwater ship repair to building a space station and doing space walks, which she said was very much like diving.
Her advice to all aspiring astronauts: follow your heart.
While it was essential to study maths and science, she said the best way to stand out was to do something you like doing.
It was important to find a career you liked doing, and if the stars aligned, might lead to a fulfilling career as an astronaut.
"Lots of people want to be astronauts, so you have to be really good and stand out in your field to get noticed," she said.
"If you pick something you don’t like because you think it will look better to become an astronaut then that’s the biggest mistake to make.
"Just stick with it and try your best."
Museum director Dr Ian Griffin said it was important all parts of society were represented in science’s future.
"We are very excited to have a Nasa astronaut that young women and under-represented groups in our community can be inspired by to see what their futures could be."
— Tim Scott, PIJF cadet reporter