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

    Oct 28, 2014 · There's a hell of a difference between importing specific named identifiers 'from module import X,Y,Z vs 'from module import *. The latter pollutes your namespace and can …

  2. Can't import my own modules in Python - Stack Overflow

    Can't import my own modules in Python Asked 13 years, 8 months ago Modified 1 year, 4 months ago Viewed 576k times

  3. python - Importing modules from parent folder - Stack Overflow

    Apr 3, 2009 · 4) Import by prepending mainfolder to every import In this example, the mainfolder would be ptdraft. This has the advantage that you will not run into name collisions with other …

  4. Importing from a relative path in Python - Stack Overflow

    from ..Common import Common As a caveat, this will only work if you run your python as a module, from outside of the package. For example: python -m Proj Original hacky way This …

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

    The recommended way for Python 2.7 and 3.1 and later is to use importlib module: importlib.import_module(name, package=None) Import a module. The name argument …

  6. How do I import other Python files? - Stack Overflow

    How do I import files in Python? I want to import: a file (e.g. file.py) a folder a file dynamically at runtime, based on user input one specific part of a file (e.g. a single function)

  7. python - How can I import a module dynamically given the full …

    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 …

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

    My issue was that it was installed for Python, but not for Python 3. To check to see if a module is installed for Python 3, run: python3 -m pip uninstall moduleName After doing this, if you find …

  9. 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 …

  10. How to import a Python class that is in a directory above?

    Jun 28, 2009 · How to load a module that is a directory up preface: I did a substantial rewrite of a previous answer with the hopes of helping ease people into python's ecosystem, and hopefully …