It's great when you can have hands-on experience allowing interactive exploration and experimentation. But it is by no means an essential part of learning a technique or technology--in computing or most other fields of human endeavor.
While you're not going to be able to master skills requiring kinesthetics (e.g. music, dance, kung fu) without doing them, programming is as much about imagining how a machine's state is arranged and how it can be guided as it is about typing commands or running code. The task needs think-time as much as touch-time, even if you have the physical gear handy and available.
There are many historical examples of students learning apart from the computer. While we've been use to having our own personal, immediately-available computers for the past 35 years, in the first half of the IT industry, machine time was very scarce and the equipment highly shared. Students programmed offline as a matter of course, then submitted their runs to the datacenter in a highly indirect fashion. This workflow continues to be common to this day with embedded devices and with new computer systems, sufficient equipment for which is simply not available for each developer to own and constantly interact with.
So your situation may not be ideal, but it's hardly intractable or unprecedented. So buckle down and learn the language by reading about it. Imagine programs you'd like to run and write them down. Then when you do get hands-on time, you'll be ready to try your ideas.
Btw, this is not just a theory. I've learned a number of languages (including Ada, Algol, APL, Fortran, Icon, Modula-2, MOT68K assembler, PL/I, Self, Smalltalk, and SNOBOL) for which I did not have a place to run code at the time. I got better later when I had more access, but the ability to run your code is manifestly not a requirement to learn at least a large swath of a programming language.