Relative Content

Tag Archive for pythonimport

Python name ‘os’ is not defined [duplicate]

This question already has answers here: NameError: name ‘datetime’ is not defined (2 answers) Closed 5 years ago. I am trying to run this python module from settings import PROJECT_ROOT DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { ‘default’: { ‘ENGINE’: ‘django.db.backends.sqlite3’, ‘NAME’ : os.path.join(BASE_DIR, ‘db_name.sqlite3’), } } # Make this unique, and don’t […]

How to list all packages that are being used in python script?

I want to check all the packages that are being used by my python script. I have a list of imports at the top of the script, but I’m not sure if those packages are actually getting used. So I want to check, of all the commands/functions I am using within by script, which of my imports are being used.