This sounds more like a bug report (GitHub Issues) than a usage question (StackOverflow), but even as a bug report, I don't see what could be going wrong from the description. It seems like something went bizarrely wrong during the installation, such that you get a module named "uproot" without any of its contents. The "open" function is the very first thing that gets imported into the "uproot" module (it's defined in "uproot.rootio" and imported into the main "uproot" namespace right after from__future__ import absolute_import
; i.e. the earliest it possibly can be).
You could try printing dir(uproot)
to see what's in it, though I suspect there will be nothing in it. I don't know how you ended up with a module named uproot without (all of?) its contents. You say you've tried different installation methods, but somehow they're all reproducing the same installation glitch. On my side, I can't reproduce itβI can't make it happen (including Python 2.7, which gets less attention these days).
On a new Docker image with no uproot installed, I did a pip install uproot
and
>>> import uproot
>>> dir(uproot)
['ArrayCache', 'FileSource', 'HTTPSource', 'LZ4', 'LZMA', 'MemmapSource',
'Pointer', 'STLMap', 'STLString', 'STLVector', 'SimpleArray',
'ThreadSafeArrayCache', 'XRootDSource', 'ZLIB', '__all__',
'__builtins__', '__doc__', '__file__', '__name__', '__package__',
'__path__', '__version__', '_connect', '_help', 'absolute_import',
'asarray', 'asdebug', 'asdouble32', 'asdtype', 'asgenobj', 'asjagged',
'asobj', 'asstlbitset', 'asstring', 'astable', 'cache', 'const',
'create', 'daskarray', 'daskframe', 'http', 'interp', 'interpret',
'iterate', 'lazyarray', 'lazyarrays', 'newbranch', 'newtree',
'numentries', 'open', 'pandas', 'recreate', 'rootio', 'source', 'tree',
'update', 'version', 'write', 'xrootd']
Are you able to install other Python packages or is it just uproot?