-
Notifications
You must be signed in to change notification settings - Fork 67
Name clash between pandas.py & pandas (python 2 on SWAN) #294
Comments
The bug is caused by Python 2 supporting implicit relative imports (see here for details). These were removed in Python 3 as they can cause difficult to understand bugs. The "new" behaviour can be enabled for a single file in Python 2.5+ by adding this as the first non-comment line: from __future__ import absolute_import I'll make a PR to add this to every file. Using |
@mhedges I guess we forgot to test Python 2. Probably the cleanest way to deal with it is to introduce a prefix on all the modules that call external libraries, like I'll do this soon. |
I was totally confused, thinking this was a bug report on awkward (so it's not relevant for your extension, @mhedges). In awkward, we could have changed pandas.py → ext_pandas.py and arrow → ext_pyarrow.py with some downstream changes to account for that, but in uproot, we really need the name to be pandas.py so that |
Thanks a lot for the quick fix you two! The new release from pypi works like a charm. |
I am using uproot on CERNs SWAN, which is hosting a jupyter notebook with a python 2 kernel. uproot 3.7.0 has been installed via
pip install --user uproot
on the SWAN node, which is essentially putting the python module into a temporary home dir on the network storage system EOS.Now copy pasting a section from uproots examples in binder
into the notebook, resulted in the following error:
Luckily the Internet is big enough, that just throwing the error message into google lead me to a useful stack overflow discussion, and renaming
~/.local/lib/python2.7/site-packages/uproot/pandas.py
to something else and replacing in__init__.py
with
really solved this problem.
I am not sure if this is just some kind of edge case or if I'm doing something silly without knowing it, but I thought I'd raise this, since other uproot users might run into this as well.
edit:
Ah, I just thought of something else.
In order to load the users python modules on SWAN, you have to start the instance with a script that modifies the environment like this:
is this bad practice in some sense?
The text was updated successfully, but these errors were encountered: