About 885,000 results
Open links in new tab
  1. python - Use 'import module' or 'from module import'? - Stack Overflow

    Oct 28, 2014 · I've tried to find a comprehensive guide on whether it is best to use import module or from module import. I've just started with Python and I'm trying to start off with best practices in mind. Bas...

  2. python - How can I import a module dynamically given the full path ...

    How do I load a Python module given its full path? Note that the file can be anywhere in the filesystem where the user has access rights. See also: How to import a module given its name as string?

  3. python - How can I import a module dynamically given its name as …

    Python defines an __import__() function, which takes a string for a module name: __import__(name, globals=None, locals=None, fromlist=(), level=0) The function imports the module name, potentially …

  4. How do I unload (reload) a Python module? - Stack Overflow

    Jan 13, 2009 · To quote from the docs: Python module’s code is recompiled and the module-level code re-executed, defining a new set of objects which are bound to names in the module’s dictionary by …

  5. Importing modules in Python - best practice - Stack Overflow

    Although Python's interpreter is optimized to not import the same module multiple times, repeatedly executing an import statement can seriously affect performance in some circumstances.

  6. python - How to import a module from a different folder ... - Stack ...

    How to import a module from a different folder? Asked 7 years, 9 months ago Modified 1 year, 2 months ago Viewed 217k times

  7. How to import a module in Python with importlib.import_module

    May 20, 2012 · How to import a module in Python with importlib.import_module Asked 13 years, 7 months ago Modified 3 years, 6 months ago Viewed 270k times

  8. How to fix "ImportError: No module named ..." error in Python?

    A better fix than setting PYTHONPATH is to use python -m module.path This will correctly set sys.path[0] and is a more reliable way to execute modules. I have a quick writeup about this problem, …

  9. Unable to import a module that is definitely installed

    Jan 13, 2013 · Next, I opened python and typed 'import sys', then 'sys.path' to show where my python searches for any packages I import. Alas, the location shown in the first step was NOT in the list. …

  10. python - Module not found - "No module named" - Stack Overflow

    If you try running python hello-world.py (from the src directory), you would have to do the following two things for this to work: Change the import line in hello-world.py to from model.order import SellOrder