jd_train/sitecustomize.py

10 lines
253 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os, site, sys
# 确保不屏蔽 user-site并把它插到 sys.path 最前
os.environ.pop("PYTHONNOUSERSITE", None)
try:
u = site.getusersitepackages()
if u and u not in sys.path:
sys.path.insert(0, u)
except Exception:
pass