First create virtual env in your IDE and set it by using given commands
python3 -m venv .venv
source .venv/bin/activate
sudo apt-get install python3-venv #If needed
python3 -m venv .venv
source .venv/bin/activate
py -3 -m venv .venv
.venv\scripts\activate
use this command in your virtual env to install wikipedia
pip install wikipedia
Now you can run this in your IDE