---
title: "Discussion on \"How to import modules from string in Python?\" | Hashnode"
description: "Discussion on \"How to import modules from string in Python?\". In Python, you can use the import statement to import a module or package into your code. However, sometimes you may want to dynamically import a module or package from a string, rather than hard coding the module or package name. In this article, we..."
url: "https://hashnode.com/posts/how-to-import-modules-from-string-in-python/63ac39b58ae1963cc455949a"
---

[Feed](https://hashnode.com/feed) /

Discussion

[Gaurav Sharma](https://hashnode.com/@mnamegaurav)

Full Stack Engineer

Dec 27, 2022

# [How to import modules from string in Python?](https://blog.devjunction.in/how-to-import-modules-from-string-in-python?utm_source=hashnode&utm_medium=feed)

In Python, you can use the import statement to import a module or package into your code. However, sometimes you may want to dynamically import a module or package from a string, rather than hard coding the module or package name. In this article, we...

blog.devjunction.in 2 min read

[#web-development](https://hashnode.com/tag/web-development) [#webdev](https://hashnode.com/tag/webdev) [#python](https://hashnode.com/tag/python) [#python3](https://hashnode.com/tag/python3) [#python-beginner](https://hashnode.com/tag/python-beginner)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
