-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
  • 5,321
  • 6
  • 33
  • 51
Mamen
  • 1,322
  • 5
  • 21
  • 44

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,322
  • 5
  • 21
  • 44