About 50 results
Open links in new tab
  1. What are all the ways to import modules in Python?

    Aug 28, 2015 · The only ways that matter for ordinary usage are the first three ways listed on that page: import module from module import this, that, tother from module import * These haven't …

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

    Like you, I prefer importing the module, but when the module lies within a package, I sometimes use from <package> import <module>, especially when the module is several sub-packages …

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

    from myapp import SomeObject though that is generally not recommended. In general, if you want other people to use your Python package, you should use distutils to create a setup script. …

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

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

    Apr 3, 2009 · 66 If adding your module folder to the PYTHONPATH didn't work, You can modify the sys.path list in your program where the Python interpreter searches for the modules to …

  6. How can I import from the standard library, when my project has a ...

    The Importing Modules section of the Python 2.7 documentation The Importing Modules section of the Python 3.2 documentation PEP 302 - New Import Hooks There are sometimes good …

  7. python - Importing files from different folder - Stack Overflow

    Programmatically importing modules was introduced in Python 3.1 and gives you more control over how modules are imported. Refer to the documentation for more information.

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

  9. Importing modules in Python and __init__.py - Stack Overflow

    Jan 16, 2014 · However, I tried adding a folder path to PYTHONPATH (Environment Variable in Windows 7). Although this folder does not contain an __init__.py file, I can still import the …

  10. Importing modules from a virtual environment in Python

    Jun 30, 2022 · I believe this to be because different versions of these came preinstalled with Python. As well, I can import os, random and anything else installed globally in Python. This …