I do my project. I need to install pip packages in python code. But I get error.
If I try this:
pip._internal.main(['install', package])
or this pip.main(['install', package])
I get this:
NameError: name 'pip' is not defined
. I use python 3.10 and pip 22. For do this code I use exec().