Problem description
When installing ccx2paraview under Ubuntu 22.04 using pip like
pip3 install --user ccx2paraview
pip will create a file ~/.local/lib/python3.10/site-packages/ccx2paraview/__init__.py that turns ccx2paraview into a Python module.
The __init__.py is empty, and therefore the module ccx2paraview -- when importing in a Python file -- has no members except again the submodule ccx2paraview (because the folder ~/.local/lib/python3.10/site-packages/ccx2paraview contains the file ccx2paraview.py).
Hence, in order to access the module elements from ccx2paraview one has to state from ccx2paraview import ccx2paraview and then all elements are again available like e.g. ccx2paraview.Converter
Desired behavior
After import ccx2paraview in a Python file have the relevant members of ccx2paraview available like ccx2paraview.Converter etc.
Potential fix
Include a file __init__.py into the ccx2paraview repository with content like
from .ccx2paraview import *
to import everything from the ccx2paraview.py or
from .ccx2paraview import Converter
from .ccx2paraview import <whatever a user needs>
I modified the empty __init__.py like this and it worked.
Problem description
When installing
ccx2paraviewunder Ubuntu 22.04 using pip likepip will create a file
~/.local/lib/python3.10/site-packages/ccx2paraview/__init__.pythat turnsccx2paraviewinto a Python module.The
__init__.pyis empty, and therefore the moduleccx2paraview-- when importing in a Python file -- has no members except again the submoduleccx2paraview(because the folder~/.local/lib/python3.10/site-packages/ccx2paraviewcontains the fileccx2paraview.py).Hence, in order to access the module elements from
ccx2paraviewone has to statefrom ccx2paraview import ccx2paraviewand then all elements are again available like e.g.ccx2paraview.ConverterDesired behavior
After
import ccx2paraviewin a Python file have the relevant members ofccx2paraviewavailable likeccx2paraview.Converteretc.Potential fix
Include a file
__init__.pyinto theccx2paraviewrepository with content liketo import everything from the
ccx2paraview.pyorI modified the empty
__init__.pylike this and it worked.