About 587,000 results
Open links in new tab
  1. How to write a Python module/package? - Stack Overflow

    481 A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py create hello.py then write the following function as its content:

  2. How to create python C++ extension with submodule that can be …

    May 10, 2023 · I'm creating a C++ extension for python. It creates a module parent that contains a sub-module child. The child has one method hello(). It works fine if I call it as import parent …

  3. Creating Python module from Fortan using CMake and make …

    Oct 3, 2023 · Creating Python module from Fortan using CMake and make yields no errors but importing module in Python fails due to undefined symbol Asked 1 year, 9 months ago …

  4. How to write python __init__.py file for module - Stack Overflow

    Apr 15, 2021 · An __init__.py file allows you to treat any directory as a Python package. It is not necessary to write anything in the file itself, just creating it in your directory is enough. So …

  5. How to locally develop a python package? - Stack Overflow

    If you run the python command from where to local module source is, that will be loaded first before the global version. You can also create a virtual environment.

  6. "Module Not Found Error" in Virtual environment - Stack Overflow

    Jul 30, 2023 · I'm a newbie with Python and been trying to install modules using pip unsuccessfully in my small project. Following advice online, I've created my own virtual …

  7. python - Creating Venv fails due to ModuleNotFoundError: No …

    Apr 30, 2025 · Problem it that (probably) module xformers>=0.0.21 may needs source code of torch to create wheel - maybe it runs different tool/python which doesn't see torch.

  8. python - What is __init__.py for? - Stack Overflow

    The __init__.py file can contain the same Python code that any other module can contain, and Python will add some additional attributes to the module when it is imported. But just click the …

  9. How do I write good/correct package __init__.py files

    Although all the functionality is implemented in modules and subpackages, your package docstring is the place to document where to start. For example, consider the python email …

  10. Creating a Python module with its dependencies self contained

    Apr 26, 2019 · 1 When creating a Python module, you can specify dependencies of your module by using the install_requires List. Lets look at this basic example.