rgerum / pylustrator

Visualisations of data are at the core of every publication of scientific research results. They have to be as clear as possible to facilitate the communication of research. As data can have different formats and shapes, the visualisations often have to be adapted to reflect the data as well as possible. We developed Pylustrator, an interface to directly edit python generated matplotlib graphs to finalize them for publication. Therefore, subplots can be resized and dragged around by the mouse, text and annotations can be added. The changes can be saved to the initial plot file as python code.
GNU General Public License v3.0
707 stars 37 forks source link

Error when importing #40

Closed PedroLormendez closed 2 years ago

PedroLormendez commented 2 years ago
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/var/folders/cn/qnt666bd35ngv1wd6gczwq900000gn/T/ipykernel_36083/1605426215.py in <module>
----> 1 import pylustrator
      2 # pylustrator.start()

~/opt/anaconda3/lib/python3.7/site-packages/pylustrator/__init__.py in <module>
     20 # along with Pylustrator. If not, see <http://www.gnu.org/licenses/>
     21 
---> 22 from .QtGuiDrag import initialize as start
     23 from .helper_functions import fig_text, add_axes, add_image, despine, changeFigureSize, mark_inset, VoronoiPlot, selectRectangle, mark_inset_pos, draw_from_point_to_bbox, draw_from_point_to_point, loadFigureFromFile, add_letter, add_letters
     24 from .QtGui import initialize as StartColorChooser

~/opt/anaconda3/lib/python3.7/site-packages/pylustrator/QtGuiDrag.py in <module>
     27 from matplotlib import _pylab_helpers
     28 
---> 29 from .QComplexWidgets import *
     30 from .ax_rasterisation import rasterizeAxes, restoreAxes
     31 from .change_tracker import setFigureVariableNames

~/opt/anaconda3/lib/python3.7/site-packages/pylustrator/QComplexWidgets.py in <module>
     31 
     32 from .ax_rasterisation import rasterizeAxes, restoreAxes
---> 33 from .change_tracker import setFigureVariableNames
     34 from .drag_helper import DragManager
     35 from .exception_swallower import swallow_get_exceptions

~/opt/anaconda3/lib/python3.7/site-packages/pylustrator/change_tracker.py in <module>
     36 from matplotlib.patches import Rectangle
     37 from matplotlib.text import Text
---> 38 from natsort import natsorted
     39 
     40 from .exception_swallower import Dummy

~/opt/anaconda3/lib/python3.7/site-packages/natsort/__init__.py in <module>
      1 # -*- coding: utf-8 -*-
      2 
----> 3 from natsort.natsort import (
      4     NatsortKeyType,
      5     OSSortKeyType,

~/opt/anaconda3/lib/python3.7/site-packages/natsort/natsort.py in <module>
    239 
    240 # Exposed for simplicity if one needs the default natsort key.
--> 241 natsort_key = natsort_keygen()
    242 natsort_key.__doc__ = """\
    243 natsort_key(val)

~/opt/anaconda3/lib/python3.7/site-packages/natsort/natsort.py in natsort_keygen(key, alg)
    210             sep = natsort.compat.locale.null_string_locale
    211         else:
--> 212             sep = natsort.compat.locale.null_string
    213         pre_sep = natsort.compat.locale.null_string
    214     regex = utils.regex_chooser(alg)

AttributeError: module 'natsort' has no attribute 'compat'
rgerum commented 2 years ago

This seems very strange as it crashes directly when importing natsort. Could you try to update natsort?

rgerum commented 2 years ago

I will close the issue for now. If you still have problems feel free to open the issue again.