-1

I have external package and i want to install it by code inside my app, the code looks like :

try:
    from pip import main as pipmain
except:
    from pip._internal import main as pipmain            

pipmain(['install', module])

# NOTE : module is string package's name

but there is an error like : TypeError: 'module' object is not callable

MrLeeh
  • 4,895
  • 3
  • 29
  • 46
Mamen
  • 1,170
  • 4
  • 17
  • 38

1 Answers1

0

So after figuring out what happen, i've found the answer in this github issue's comment

it should be pipmain.main() not pipmain()

Mamen
  • 1,170
  • 4
  • 17
  • 38