If you want to run against a local mediawiki instance, you'll have to adjust the API_URL settings in the pip package's wikipedia.py (usually in /usr/local/lib/python3.6/dist-packages/wikipedia/) to match your local instance. If you've downloaded the simple wikipedia for simplicity's sake, then you may wish to force the lang to "simple" always, as you may not find answers otherwise.
If you want to run against a local mediawiki instance, you'll have to adjust the API_URL settings in the pip package's wikipedia.py (usually in /usr/local/lib/python3.6/dist-packages/wikipedia/) to match your local instance. If you've downloaded the simple wikipedia for simplicity's sake, then you may wish to force the lang to "simple" always, as you may not find answers otherwise.