if not (d == "bokeh" or d.startswith("bokeh-")):
continue
prompt = "Found existing bokeh install: %s\nRemove it? [y|N] " % bokeh_path
val = input(prompt)
if val == "y":
print("Removing old bokeh install...", end=" ")
try:
if isdir(bokeh_path): shutil.rmtree(bokeh_path)
After Change
def check_remove_bokeh_install(site_packages):
old_bokeh_files = []
for d in os.listdir(site_packages):
bokeh_path = join(site_packages, d)
if not (d == "bokeh" or d.startswith("bokeh-")):
continue
old_bokeh_files.append(bokeh_path)
if len(old_bokeh_files) == 0:
return
print("Found old bokeh files:")