Jan-28-2024, 05:07 PM
I've tried every permutation I can think of to get rid of this message - eg variables, literals, back slashes, forward slashes etc etc (thinking that was the issue) - But looking at the error on the internet, it maybe something more environment related, which I don't understand - If anyone has the answer, please could you post it in beginner speak!
NB - Database exists - C:/Users/gonks/Desktop/python_work/db/VE_match
table exists in it - db_val_policy
input CSV exits - C:/Users/gonks/Desktop/python_work/csv_val_pol.csv
NB - Database exists - C:/Users/gonks/Desktop/python_work/db/VE_match
table exists in it - db_val_policy
input CSV exits - C:/Users/gonks/Desktop/python_work/csv_val_pol.csv
from pathlib import Path import sqlite3 import subprocess import csv #csv_file = Path("C:/Users/gonks/Desktop/python_work/csv_val_pol.csv") #db_name = Path("C:/Users/gonks/Desktop/python_work/db/VE_match") csv_file = Path("C:\\Users\\gonks\\Desktop\\python_work\\csv_val_pol.csv") db_name = Path("C:\\Users\\gonks\\Desktop\\python_work\\db\\VE_match") result = subprocess.run(['sqlite3', "C:\\Users\\gonks\\Desktop\\python_work\\db\\VE_match".replace('\\','\\\\'), '-cmd', '.mode csv', '.import --skip 1 C:\\Users\\gonks\\Desktop\\python_work\\db\\VE_match'.replace('\\','\\\\'), 'db_val_policy'], capture_output=True)
Error:File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
PS C:\Users\gonks>