Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Auto-install missing python modules
import sys
import pip
from importlib import import_module
from import MetaPathFinder
class PipMetaPathFinder(MetaPathFinder):
"""A to auto-install missing modules using pip
def find_spec(fullname, path, target=None):
if path == None:
installed = pip.main(['install', fullname])
if installed == 0:
return import_module(fullname)
Copy link

My python compiler is saying that Attribution error: 'list' object has no attribute 'append'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment