Skip to content

Instantly share code, notes, and snippets.

@saketkc
Created June 25, 2020 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saketkc/6761424f71d2f8974db45e57d7004d54 to your computer and use it in GitHub Desktop.
Save saketkc/6761424f71d2f8974db45e57d7004d54 to your computer and use it in GitHub Desktop.
import re
import sys
import os
sys.path = ['', '/env/python', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/local/lib/python3.6/dist-packages/IPython/extensions', '/root/.ipython']
print('***********************************************************************')
print('Let us check on those pyarrow and cffi versions...')
print('***********************************************************************')
print()
pyarrow_version = sys.modules["pyarrow"].__version__
f = re.search("0.15.+", pyarrow_version)
if(f == None):
for key in list(sys.modules.keys()):
if key.startswith("pyarrow"):
del sys.modules[key]
print(f"unloaded pyarrow {pyarrow_version}")
import pyarrow
pyarrow_version = sys.modules['pyarrow'].__version__
print(f"loaded pyarrow {pyarrow_version}")
print(f"You're now running pyarrow {pyarrow_version} and are good to go!")
del(pyarrow_version)
else:
print(f"You're running pyarrow {pyarrow_version} and are good to go!")
cffi_version = sys.modules['cffi'].__version__
f = re.search("1.13.+", cffi_version)
if f == None:
for key in list(sys.modules.keys()):
if key.startswith('cffi'):
del sys.modules[key]
print(f"unloaded cffi {cffi_version}")
import cffi
cffi_version = sys.modules['cffi'].__version__
print(f"loaded cffi {cffi_version}")
del(cffi_version)
else:
print(f"cffi {cffi_version} is good to go!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment