Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

KeyError: 'getpwuid(): uid not found: 14033'

+6 votes
asked Oct 22, 2020 by Alexander (190 points)
It says the error is on line 2 but it really activates when I use archive =  = pd.read_csv("C:/Users/Instructor/Downloads/metadata/metadata.csv")

  File "main.py", line 2, in <module>                                                  

    import pandas as pd                                                                

  File "/usr/lib/python3/dist-packages/pandas/__init__.py", line 40, in <module>       

    from pandas.core.api import *                                                      

  File "/usr/lib/python3/dist-packages/pandas/core/api.py", line 12, in <module>       

    from pandas.core.series import Series, TimeSeries                                  

  File "/usr/lib/python3/dist-packages/pandas/core/series.py", line 2617, in <module>  

    import pandas.tools.plotting as _gfx                                               

  File "/usr/lib/python3/dist-packages/pandas/tools/plotting.py", line 23, in <module

import pandas.tseries.converter as conv                                            

  File "/usr/lib/python3/dist-packages/pandas/tseries/converter.py", line 7, in <module

>                                                                                      

    import matplotlib.units as units                                                   

  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 967, in <module>  

    rcParams = rc_params()                                                             

  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 876, in rc_params

    fname = matplotlib_fname()                                                         

  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 744, in matplotlib

_fname            

    configdir = _get_configdir()                                                       

  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 613, in _get_confi

gdir                                                                                   

    return _get_config_or_cache_dir(_get_xdg_config_dir())                             

  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 590, in _get_confi

g_or_cache_dir                                                                         

    return _create_tmp_config_dir()   

  File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 522, in _create_tm

p_config_dir                                                                           

    tempdir = os.path.join(tempdir, 'matplotlib-%s' % getpass.getuser())               

  File "/usr/lib/python3.4/getpass.py", line 170, in getuser                           

    return pwd.getpwuid(os.getuid())[0]                                                

KeyError: 'getpwuid(): uid not found: 14100'

1 Answer

0 votes
answered Feb 5, 2021 by KKN (1,110 points)

Sorry burst your bubble, but you can't import pandas as, well, anything. I don't know why onlinegdb doesn't support it for pandas, but they support it for stuff like numpy. Maybe they have to update to a newer version of pandas.

Hope this helped!

EDIT: I tried it myself, threw the same error.

FIX: You might want get the newest version of matplotlib (and python for that matter) using pip in the command shell and create the csv directory; then paste the code in an IDE. Maybe, just maybe, it will work there.

If that doesn't work, you may want to ask your question on stack overflow.

regards (or whatever)

KKN :)

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...