Yes, you were right. thanks.
El mié, 23 feb 2022 a la(s) 13:34, Mike Bayer (mike...@zzzcomputing.com) escribió: > the "from msilib import schema" import is at the top of your script. it > looks like it's there by accident. are you using vscode? I find it often > adds random package names as it guesses from my typing. I'd remove that > line. > > > On Wed, Feb 23, 2022, at 1:54 PM, Nahum Castro wrote: > > 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 sqlalchemy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/CABqArLi8j1uLmLZ1wBQFWEFoVp26KtLLfw0W8_oNc8mSRV0%2B1g%40mail.gmail.com > <https://groups.google.com/d/msgid/sqlalchemy/CABqArLi8j1uLmLZ1wBQFWEFoVp26KtLLfw0W8_oNc8mSRV0%2B1g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > > -- > 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 sqlalchemy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/1602204e-c1b3-4cf9-8428-6f7eb15d4d47%40www.fastmail.com > <https://groups.google.com/d/msgid/sqlalchemy/1602204e-c1b3-4cf9-8428-6f7eb15d4d47%40www.fastmail.com?utm_medium=email&utm_source=footer> > . > -- *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 sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/CABqArLgqa_MVFcuzeZyGO2yAYyQzv8G98MRPmmtgH0zgSYFSAQ%40mail.gmail.com.