Hello All.
I have a problem when I try to load a dataframe to postgresql and store it
in a schema..
from msilib import schema
import pandas as pd
import numpy as np
import glob
from sqlalchemy import create_engine
from datetime import datetime, timedelta
engine = create_engine('postgresql://nahum:inifedal@localhost:5432/dbwork')
archivos2=(glob.glob(
"/Users/nahumcastro/Documents/mdt_work_files/records.csv"))
df_telcel = pd.DataFrame(archivos2)
for index, row in df_telcel.iterrows():
datastore=pd.read_csv(str(row[0]), delimiter=',')
datastore.to_sql('records', engine, schema='work')
The problem that I have is that it asks for a library (msilib) available
only on windows.
https://docs.python.org/3/library/msilib.html
If I do not use schema 'work' to store only in public schema there is no
problem at all.
/usr/local/bin/python3 /Users/nahumcastro/Documents/load.py
Traceback (most recent call last):
File "/Users/nahumcastro/Documents/load.py", line 1, in <module>
from msilib import schema
ModuleNotFoundError: No module named 'msilib'
I am on a macintosh computer.
python 3.9.10
pandas is 1.4.1
sqlalchemy is 1.4.29
Thanks in advance for any help.
Nahum
--
*Nahum Castro González*
Blvd. Perdigón 214, Brisas del Lago.
CP 37207
León, Guanajuato, México
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/CABqArLi8j1uLmLZ1wBQFWEFoVp26KtLLfw0W8_oNc8mSRV0%2B1g%40mail.gmail.com.