If you want to make an experiment or just trying some python script from internet, better you use virtual environment or use jupyter notebook
Install virtual env
sudo apt-get install python-virtualenv
create virtual env
virtualenv -p /usr/bin/python3 Workspace/env
start virtual env
source Workspace/env/bin/activate
running the script inside virtual env
…..
stop virtual env
deactivate