There are a lot of people who will tell you can you (read: they) can only write in the ideal place: quiet, surrounded by books, often in an oak-and-leather study with filtered afternoon light. Sounds great, but that's not the only place that can be effective for you. Stacey Pigg (2014) found that one of the great unteachable skills for undergraduate writers is learning where you personally can focus. Because you can be so flexible as a graduate student, you're fortunate to have a wide range of options: coffee shops, libraries, home, etc. Try a couple of these and find what works best for you.
But also recognize that just as there are different kinds of writing, there are different kinds of writing environments. For example, I'm sitting at the reception desk of Austin Pets Alive! which is a noisy place where I'm frequently interrupted; it's a bad place for be to do the sustained, focused- writing on a book chapter, but it's great for grammar-checking the proofs my editor sent me and writing you all an email. I'll do the quiet work in my office later today. Just because you're stuck in a dentist's waiting room or there's a tornado warning or you left the book you need at home doesn't mean you can't write: you might just have to do a different kind of writing.
You might also consider what goes into a writing environment besides just the space around you. You might invest in noise-canceling headphones or earplugs, or use an ergonomic chair or put your laptop on a cabinet to stand and write, as some of my colleagues have. Environment also might include digital resources--do you need to turn off the internet or disable Facebook or set your phone to airplane mode?
Ultimately you can be successful in any place where you can write. I wrote a big chunk of my dissertation in the Walmart auto waiting room because it was the only place close to my house that was open in the very early hours. I put on headphones and hunkered down and no one asked me if I was waiting on a tire change.