He was born on 27 May 1876, on his family's manor near Ludza in the Vitebsk Governorate (now Latvia). His family was of Lipka Tatar descent. He studied at the famous gymnasium in Kamieniec Podolski, but he moved with his father, a renowned doctor, to Saint Petersburg, where he graduated from a Russian language school. Then he joined the mathematical-physical faculty of the local university, where he studied chemistry. As an assistant to professor Aleksander Zalewski, he traveled to many distant areas, including Siberia, the Caucasus and the Altay Mountains. During the summer, he was frequently enrolled as a ship's writer on the Odessa-Vladivostok line, a job that allowed him to visit many parts of Asia, including Japan, Sumatra, China, Malaya and Indonesia. For his description of his trip to Crimea and Constantinople, he received his first royalty. His record of a trip to India ("Chmura nad Gangesem": "A Cloud Over the Ganges") gained the prestigious "Petersburg Society of Literature" prize.