Forum

Author Topic: Installing external python libraries in Metashape Pro  (Read 6113 times)

ScubaDiving

  • Newbie
  • *
  • Posts: 5
    • View Profile
Installing external python libraries in Metashape Pro
« on: April 19, 2021, 04:12:43 PM »
Hello everyone,

I'm trying to write some code which uses pandas for some data proccessing. I'm able to test it easily using Anaconda but I'm unable to run the whole program in metshape because pandas is not installed in Metashape's python interpreter.

I've tried installing it with the methods decribed here: https://www.agisoft.com/forum/index.php?topic=3412.0 and here: https://agisoft.freshdesk.com/support/solutions/articles/31000136860-how-to-install-external-python-module-to-photoscan-professional-pacakge

without results. When I try to use
Code: [Select]
python -m pip install pandas I get a syntax error as attached here.

I'm kind of lost right now because it seems I just can't get it to work... any help will be appreciated.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15146
    • View Profile
Re: Installing external python libraries in Metashape Pro
« Reply #1 on: April 20, 2021, 02:36:59 PM »
Hello ScubaDiving,

Which OS version you are using and which version of Metashape Pro?
Best regards,
Alexey Pasumansky,
Agisoft LLC

ScubaDiving

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Installing external python libraries in Metashape Pro
« Reply #2 on: April 26, 2021, 09:42:44 PM »
Hello ScubaDiving,

Which OS version you are using and which version of Metashape Pro?

Hi,

I'm using Metashape 1.6.4 on Windows 10.
« Last Edit: April 28, 2021, 08:46:28 PM by ScubaDiving »

lyhour

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: Installing external python libraries in Metashape Pro
« Reply #3 on: December 19, 2021, 05:10:58 PM »
Hello ScubaDiving,

Do you solve the problem. I face the problem the same to you.

ScubaDiving

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Installing external python libraries in Metashape Pro
« Reply #4 on: December 19, 2021, 06:59:26 PM »
Hello ScubaDiving,

Do you solve the problem. I face the problem the same to you.

Hi,

It seems Metashape’s internal python interpreter can’t really accept installing libraries like that. What I ended up doing was installing the Metashape python .whl library into pycharm and running my code there, rather than inside the Metashape program (and avoiding it’s interpreter).

lyhour

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: Installing external python libraries in Metashape Pro
« Reply #5 on: December 21, 2021, 05:16:18 PM »
thank you very much for you reply. I solve the problem already. I am using the windows 10 so I am using this command: "%programfiles%\Agisoft\Metashape Pro\python\python.exe" -m pip install python_module_name" to install numpy. It is working. Noted that we have to remove the some conflict path in environment variable. For my case I create multiple path and PYTHONPATH. So it is conflict dependency. I remove it, the problem solve.