google / ml-fairness-gym

Apache License 2.0
311 stars 79 forks source link

Update folders or imports in quick start #11

Open kjm0623v opened 4 years ago

kjm0623v commented 4 years ago

Hello. Thanks for ML for fairness!

(venv) ➜ experiments git:(master) ✗ python ./lending_demo.py --num_steps=500 Traceback (most recent call last): File "./lending_demo.py", line 26, in from agents import threshold_policies

I already use the PATH code export PYTHONPATH="${PYTHONPATH}:/path/to/ml-fairness-gym" After ./tests.sh File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 285, in line self._line = linecache.getline(self.filename, self.lineno).strip() File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py", line 16, in getline lines = getlines(filename, module_globals) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py", line 48, in getlines for mod in sys.modules.values(): RuntimeError: dictionary changed size during iteration

And there I can not proceed anymore from here.

hansa0 commented 4 years ago

Hi kjm0623v,

I wasn't able to re-create your error. Did you install the requirements as described in the installation instructions? Additionally, another common mistake (and one I made): when you ran export PYTHONPATH="${PYTHONPATH}:/path/to/ml-fairness-gym" did you change "/path/to/ml-fairness-gym" to your specific path before running the command?

Chuyun-Shen commented 4 years ago

Hi kjm0623v, Maybe you can check your path, use

import sys
print(sys.path)

make sure source root is in path