Closed jengelman closed 7 years ago
Can you do swig -version
and paste the output?
SWIG Version 3.0.10
Compiled with g++ [x86_64-apple-darwin11.4.2]
Configured options: +pcre
The ->
arrow notation is Python 3 syntax. The most likely reason for this error is you compiled paratext
with Python 3 and imported it with Python 2.
Another thing to note: the stack trace indicates you are pulling from the current directory rather than the prefix where you installed Paratext.
@deads Tried recompiling with Python2, cd'd to the tests folder, and ran the following
import paratext
df = paratext.load_csv_to_pandas("hepatitis.csv")
and got the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/joshengelman/miniconda2/envs/paratext/lib/python2.7/site-packages/paratext/core.py", line 403, in load_csv_to_pandas
return pandas.DataFrame.from_items(expanded)
File "/usr/local/lib/python2.7/site-packages/pandas/core/frame.py", line 1158, in from_items
keys, values = lzip(*items)
File "/Users/joshengelman/miniconda2/envs/paratext/lib/python2.7/site-packages/paratext/core.py", line 355, in load_csv_to_expanded_columns
for name, col, semantics, levels in load_raw_csv(filename, *args, **kwargs):
File "/Users/joshengelman/miniconda2/envs/paratext/lib/python2.7/site-packages/paratext/core.py", line 298, in load_raw_csv
loader = internal_create_csv_loader(filename, *args, **kwargs)
File "/Users/joshengelman/miniconda2/envs/paratext/lib/python2.7/site-packages/paratext/core.py", line 188, in internal_create_csv_loader
loader.load(_make_posix_filename(filename), params)
File "/Users/joshengelman/miniconda2/envs/paratext/lib/python2.7/site-packages/paratext_internal.py", line 530, in load
return _paratext_internal.ColBasedLoader_load(self, filename, params)
RuntimeError: locale::facet::_S_create_c_locale name not valid
It did not. I checked the language settings, and they look correct:
(paratext) Joshs-MacBook-Pro:tests joshengelman$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"`
Does export LC_ALL="C" work for you?
Yup, thanks!
I made a virtualenv to test out the package, and importing the module into python failed as follows: