import shutil | |
import os | |
try: | |
print("Importing nltk files...") | |
# Define source and destination paths | |
source_folder = '/home/user/app/nltk_data' | |
destination_folder = '/home/user/nltk_data' | |
# Ensure the destination folder exists, create if it doesn't | |
os.makedirs(destination_folder, exist_ok=True) | |
# Move the source folder to the destination | |
shutil.move(source_folder, destination_folder) | |
print(f"NLTK folder moved to {destination_folder}") | |
except FileNotFoundError as fnf_error: | |
print(f"Error: Source folder not found. {fnf_error}") | |
except PermissionError as perm_error: | |
print(f"Error: Permission denied. {perm_error}") | |
except Exception as e: | |
print(f"An unexpected error occurred: {e}") | |