On one occasion the Blessed One was living at Savatthi in Jeta's Grove, Anathapindika's Park. There he addressed the bhikkhus thus: "Bhikkhus, I shall teach you a discourse on jungle thickets. Listen and attend closely to what I shall say. Here, bhikkhus, a bhikkhu lives in some jungle thicket While he is living there his un-established mindfulness does not become established, his un-concentrated mind does not become concentrated, his un-destroyed taints do not come to destruction, he does not attain the un-attained supreme security from bondage; and also the requisites of life that should be obtained by one gone forth - robes, alms food, resting place, and medicinal requisites - are hard to come by.
The bhikkhu should consider thus: 'I am living in this jungle thicket. While I am living here my unestablished mindfulness does not become established... I do not attain the un-attained supreme security from bondage; and also the requisites of life...are hard to come by.' That bhikkhu should depart from that jungle thicket that very night or that very day; he should not continue living there. (If unable to achieve mindfulness and fruits of practice and if requisites are hard to come by then the monk should leave the place and find other secluded place to practice)
"Here a bhikkhu lives in some jungle thicket. While he is living there his un-established mindfulness does not become established, his un-concentrated mind does not become concentrated, his un-destroyed taints do not come to destruction, he does not attain the un-attained supreme security from bondage; yet the requisites of life that should be obtained by one gone forth...are easy to come by. The bhikkhu should consider thus: 'I am living in this jungle thicket. While I am living here my un-established mindfulness does not become established...I do not attain the un-attained supreme security from bondage; yet the requisites of life that should be obtained by one gone forth...are easy to come by. However, I did not go forth from the home life into homelessness for the sake of robes, almsfood, resting place, and medicinal requisites. Moreover, while I am living here my un-established mindfulness does not become established...I do not attain the un-attained supreme security from bondage.' Having reflected thus, that bhikkhu should depart from that jungle thicket; he should not continue living there. (If unable to achieve mindfulness and fruits of practice and even if requisites are easy to come by then the monk should leave the place and find other secluded place to practice) "Here, bhikkhus, a bhikkhu lives in some jungle thicket. While he is living there his un-established mindfulness becomes established, his un-concentrated mind becomes concentrated, his un-destroyed taints come to destruction, he attains the un-attained supreme security from bondage; yet the requisites of life that should be obtained by one gone forth.. .are hard to come by. The bhikkhu should consider thus: ' While I am living here my un-established mindfulness has become established...I have attained the un-attained supreme security from bondage; yet the requisites of life...are hard to come by. However, I did not go forth from the home life into homelessness for the sake of robes, alms food, resting place, and medicinal requisites.' Having reflected thus, that bhikkhu should continue living in that jungle thicket; he should not depart. (If able to achieve mindfulness and fruits of practice and even if requisites are hard to come by then the monk should stay and continue to practice)
"Here, bhikkhus, a bhikkhu lives in some jungle thicket. While he is living there his un-established mindfulness becomes established, his un-concentrated mind becomes concentrated, his un-destroyed taints come to destruction, he attains the un-attained supreme security from bondage; and also the requisites of life are easy to come by. In such a case, that bhikkhu should continue living in that jungle thicket as long as life lasts; he should not depart. (If able to achieve mindfulness and fruits of practice and requisites are easy to come by then the monk should stay as long as possible and continue to practice)
"Here, bhikkhus, a bhikkhu lives in dependence upon a certain village.. (As above if he is able to achieve mindfulness and fruits of practice, even if requisites are hard or easy to come by then the monk should stay put and practice.)
"Here, bhikkhus, a bhikkhu lives in dependence upon a certain town... (As above if he is able to achieve mindfulness and fruits of practice, even if requisites are hard or easy to come by then the monk should stay put and practice.)
"Here, bhikkhus, a bhikkhu lives in dependence upon a certain city... (As above if he is able to achieve mindfulness and fruits of practice, even if requisites are hard or easy to come by then the monk should stay put and practice.)
"Here, bhikkhus, a bhikkhu lives in dependence upon a certain country... (As above if he is able to achieve mindfulness and fruits of practice, even if requisites are hard or easy to come by then the monk should stay put and practice.)
"Here, bhikkhus, a bhikkhu lives in dependence upon a certain person...(There are scenarios, situations and benefits to reflect upon if the bhikkhu should depart from that person or he should not continue following him and not depart from him as per above similes of a monk living in the jungle thicket).....
That is what the Blessed One said. The bhikkhus were satisfied and delighted in the Blessed One's words.
In summary, in this discourse Buddha explains and encourages meditators to reflect on whether one’s environment is genuinely supporting their meditation practice, and if not one should leave. If that place allows his un-established mindfulness to become established, his un-concentrated mind becomes concentrated, his un-destroyed taints come to destruction, he attains the un-attained supreme security from bondage; but the requisites of life are hard to come by. In such a case, that bhikkhu should continue living in that jungle thicket.
If that place allows his un-established mindfulness to become established, his un-concentrated mind becomes concentrated, his un-destroyed taints come to destruction, he attains the un-attained supreme security from bondage; and also the requisites of life are easy to come by. In such a case, that bhikkhu should continue living in that jungle thicket as long as life lasts.
But if he cannot get much mindfulness and requisites are hard to come by then he should leave and move to other secluded place to practice instead. Similarly one should reflect whether a town, city, village, country is beneficial and suitable for meditating if not he has to leave and go other places.
References: 1. www.accesstoinsight.org 2. https://suttacentral.net/ 3. The middle length discourses of the Buddha (Bhikkhu Bodhi)