About 50 results
Open links in new tab
  1. 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)

  2. Properly importing modules in Python - Stack Overflow

    Jun 24, 2013 · I have a medium size Python application with modules files in various subdirectories. I have created modules that append these subdirectories to sys.path and …

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

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

    Can't import my own modules in Python Asked 13 years, 11 months ago Modified 1 year, 7 months ago Viewed 579k times

  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 …

  6. How can I do relative imports in Python? - Stack Overflow

    I do the relative imports as from ..sub2 import mod2 and then, if I want to run mod1.py then I go to the parent directory of app and run the module using the python -m switch as python -m …

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

  8. python - Import module from subfolder - Stack Overflow

    Just create an empty __init__.py file and add it in root as well as all the sub directory/folder of your python application where you have other python modules.

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

  10. Conditional import of modules in Python - Stack Overflow

    Jan 10, 2017 · Conditional import of modules in Python [duplicate] Asked 15 years, 5 months ago Modified 3 years, 3 months ago Viewed 160k times