Created
June 17, 2020 14:55
-
-
Save ColdGrub1384/ed31b637061eac40970614a752c260e7 to your computer and use it in GitHub Desktop.
Fixes C extensions when ODR fail to load and scripts are in site-packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from extensionsimporter import DownloadableImporter, update_mods, c | |
from pyto import __Class__ | |
import sys | |
import threading | |
try: | |
__Class__("PyCore").startupScript = threading.current_thread().script_path | |
except AttributeError: | |
pass # Running from startup | |
for path in sys.meta_path: | |
if isinstance(path, DownloadableImporter): | |
sys.meta_path.remove(path) | |
break | |
initializers = [ | |
c.init_matplotlib, | |
c.init_pandas, | |
c.init_biopython, | |
c.init_lxml, | |
c.init_scipy, | |
c.init_sklearn, | |
c.init_skimage, | |
c.init_pil, | |
c.init_numpy, | |
c.init_cffi, | |
c.init_bcrypt, | |
c.init_pywt, | |
c.init_statsmodels, | |
c.init_zmq, | |
c.init_gensim, | |
c.init_regex, | |
c.init_astropy, | |
c.init_emd, | |
c.init_cv2, | |
c.init_nacl, | |
] | |
for init in initializers: | |
init() | |
update_mods() | |
print("Done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment