I cannot integrate this code 1 to 1 in PyCharm because the instructions such as !mkdir ~/.kaggle are not recognized.
How can I rebuild this source code so that it also works in Pycharm? Thanks in advance.
import os
import json
import zipfile
import glob
username_kaggle = "dummy"
token_kaggle = "token"
savepath = "/content/dataset/retailrocket"
if not os.path.exists(savepath):
os.makedirs(savepath)
os.chdir(savepath)
# Download the dataset from kaggle
!pip install kaggle
!mkdir ~/.kaggle
!touch ~/.kaggle/kaggle.json
api_token = {"username":username_kaggle,"key":token_kaggle}
with open('/root/.kaggle/kaggle.json', 'w') as file:
json.dump(api_token, file)
!kaggle datasets download -d retailrocket/ecommerce-dataset