TypeError: string indices must be integers
jnmclarty opened this issue · comments
Jeffrey McLarty commented
- PyEnvDiff version: 0.1.0
- Python version: 3.6
- Operating System: Windows
Description
pyenvdiff fails to serialize the environment information to the console.
What I Did
run
python -m pyenvdiff.info
Error
Traceback (most recent call last):
File "/home/jmclarty/anaconda3/envs/py36/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/jmclarty/anaconda3/envs/py36/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/jmclarty/proj/pyenvdiff-lib/pyenvdiff/info.py", line 9, in <module>
print(env)
File "/home/jmclarty/proj/pyenvdiff-lib/pyenvdiff/environment.py", line 102, in __str__
out.append(str(info_set[key]))
File "/home/jmclarty/proj/pyenvdiff-lib/pyenvdiff/collectors.py", line 162, in __str__
out = [" ".join([str(i[a]) for a in self.attrs]) for i in self.info]
File "/home/jmclarty/proj/pyenvdiff-lib/pyenvdiff/collectors.py", line 162, in <listcomp>
out = [" ".join([str(i[a]) for a in self.attrs]) for i in self.info]
File "/home/jmclarty/proj/pyenvdiff-lib/pyenvdiff/collectors.py", line 162, in <listcomp>
out = [" ".join([str(i[a]) for a in self.attrs]) for i in self.info]
TypeError: string indices must be integers
Jeffrey McLarty commented
The root cause here is that the pip team moved the get_installed_distribution function somewhere around pip v10. More info: pypa/pip#5243