Sibling package imports
I’ve tried reading through questions about sibling imports and even the
package documentation, but I’ve yet to find an answer.
I’ve tried reading through questions about sibling imports and even the
package documentation, but I’ve yet to find an answer.
Python’s easy_install makes installing new packages extremely convenient. However, as far as I can tell, it doesn’t implement the other common features of a dependency manager – listing and removing installed packages.
Is there a straightforward way to find all the modules that are part of a python package? I’ve found this old discussion, which is not really conclusive, but I’d love to have a definite answer before I roll out my own solution based on os.listdir().
Long story short my work computer has network constraints which means trying to use pip install in cmd just leads to timing out/not finding package errors.
I’m starting to learn python and loving it. I work on a Mac mainly as well as Linux. I’m finding that on Linux (Ubuntu 9.04 mostly) when I install a python module using apt-get it works fine. I can import it with no trouble.
I’ve come across situations where a current version of a package seems not to be working and requires reinstallation. But pip install -U won’t touch a package that is already up-to-date. I see how to force a reinstallation by first uninstalling (with pip uninstall) and then installing, but is there a way to simply force an “update” to a nominally current version in a single step?
Been playing with cython. Normally program in Python, but used C in a previous life.
I can’t figure out how to make a free-standing executable.
I want to define a constant that should be available in all of the submodules of a package. I’ve thought that the best place would be in in the __init__.py file of the root package. But I don’t know how to do this. Suppose I have a few subpackages and each with several modules. How can I access that variable from these modules?
My package has the following structure:
I am trying to organize some modules for my own use. I have something like this: