About 157,000 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. Importing from a relative path in Python - Stack Overflow

    Python 2.6 and 3.x supports proper relative imports, where you can avoid doing anything hacky. With this method, you know you are getting a relative import rather than an absolute import.

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

    Relative import is working for me too Version: Python 3.13.7 folder structure app/ ├─ main.py ├─ helpers/ │ ├─ my_helper_file.py ├─ venv/ # virtual environment and I import functions from …

  4. How to install Python packages for Spyder - Stack Overflow

    May 21, 2023 · I am using the IDE called Spyder for learning Python. I would like to know in how to go about in installing Python packages for Spyder?

  5. python - `from ... import` vs `import .` - Stack Overflow

    Feb 25, 2012 · I'm wondering if there's any difference between the code fragment from urllib import request and the fragment import urllib.request or if they are interchangeable. If they are …

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

    If you want to directly run python TestCase.py, you would have to mess with your path. This can be done within Python: import sys sys.path.append("..") from myapp import SomeObject …

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

    I am new to Python as I want to expand skills that I learned using R. In R I tend to load a bunch of libraries, sometimes resulting in function name conflicts. What is best practice in Python. I h...

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

    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 …

  9. Unable to import a module that is definitely installed

    Jan 13, 2013 · Then pip agreed it needed to be installed, installed it, and my script ran. Or even better, use python -m pip install <package>. The benefit of this is, since you are executing the …

  10. How to install a new python module on VSCode? - Stack Overflow

    Aug 1, 2019 · One of them is install On the Python library platform, you always have the command to be copied in order to the installation of package you want. In your terminal, the …