ModuleNotFoundError: No module named 'pwd', Python 3 matplotlib via cgi på windows
Jag har en enkel hemsida som får in lite data som ska plottas med matplotlib via cgi. Men är jag försöker importera matplotlib får jag följande error:
C:\wampstack-5.6.24-0\apache2\cgi-bin\makeImage.py in ()
10
11 #For plotting
=> 12 import matplotlib.pyplot as pyplot
13
14 #Setting the image size
matplotlib undefined, pyplot undefined
C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\__init__.py in ()
1180
1181 # this is the instance used by the matplotlib classes
=> 1182 rcParams = rc_params()
1183
1184 if rcParams['examples.directory']:
rcParams undefined, rc_params = <function rc_params>
C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\__init__.py in rc_params(fail_on_error=False)
1013 default matplotlib rc file.
1014 """
=> 1015 fname = matplotlib_fname()
1016 if not os.path.exists(fname):
1017 # this should never happen, default in mpl-data should always be found
fname undefined, global matplotlib_fname = <function matplotlib_fname>
C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\__init__.py in matplotlib_fname()
823 return fname
824
=> 825 configdir = _get_configdir()
826 if configdir is not None:
827 fname = os.path.join(configdir, 'matplotlibrc')
configdir undefined, global _get_configdir = <function _get_configdir>
C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\__init__.py in _get_configdir()
678 5. A writable directory could not be found or created; return None.
679 """
=> 680 return _get_config_or_cache_dir(_get_xdg_config_dir())
681
682 get_configdir = verbose.wrap('CONFIGDIR=%s', _get_configdir, always=False)
global _get_config_or_cache_dir = <function _get_config_or_cache_dir>, global _get_xdg_config_dir = <function _get_xdg_config_dir>
C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\__init__.py in _get_config_or_cache_dir(xdg_base=None)
655 return p
656
=> 657 return _create_tmp_config_dir()
658
659
global _create_tmp_config_dir = <function _create_tmp_config_dir>
C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\__init__.py in _create_tmp_config_dir()
581 return None
582 try:
=> 583 username = getpass.getuser()
584 except KeyError:
585 username = str(os.getuid())
username undefined, getpass = <module 'getpass' from 'C:\\Program Files (x86)\\Python36-32\\lib\\getpass.py'>, getpass.getuser = <function getuser>
C:\Program Files (x86)\Python36-32\lib\getpass.py in getuser()
166
167 # If this fails, the exception will "explain" why
=> 168 import pwd
169 return pwd.getpwuid(os.getuid())[0]
170
pwd undefined
ModuleNotFoundError: No module named 'pwd'
args = ("No module named 'pwd'",)
msg = "No module named 'pwd'"
name = 'pwd'
path = None
with_traceback = <built-in method with_traceback of ModuleNotFoundError object>
Jag har letat efter pwd och winpwd men pip hittar inget och jag hittar inte så mycket information på google.
Allt fungerar via pythons shell men inte i cgi.
Jag installerade Anaconda och testade igen men jag fick exakt samma error
| i5 4690k 4.7GHz @ 1.245V på Luft | 16GB | R9 280X @ 1200MHz |