Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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