Installing external python moduls

Hello,
can someone explain me how to install the external python modul (for example pandas) via cmd.

I think it should be very easy but i am not sure if I have to set the path to the sitepackage before run pip and i also can not find the pip modul

Dear Sen,

please try the following steps:

• Open a windows command prompt as administrator
• cd to C:\Program Files\Itasca\PFC700\exe64\python36\Scripts
• issue “pip install pandas”

Regards,
Nils

2 Likes

Dear Nils,

I tried to follow this recommendation on FLAC3D 9.0, but get the error message:

Fatal error in launcher: Unable to create process using '“C:\mypython310\python.exe” “C:\Program Files\Itasca\ItascaSoftware900\exe64\python310\Scripts\pip.exe”

It seems that the supplied pip.exe is looking for the python.exe at the wrong location, since there is and (to my knowledge) never has been a “C:\mypython310\python.exe” on my PC.

Hi, all!

First of all, all the best for 2023!

Nils’ suggestion should work fine, but there may be issues due to the path environment variable on Windows. You can force the execution of the local pip by writing .\pip.exe in the prompt. You can check that the pip you executed routes to the desired Python using the --version keyword:

> cd C:\Program Files\Itasca\Flac3d700\exe64\python36\Scripts
> .\pip.exe --version
pip 21.3.1 from c:\program files\itasca\flac3d700\exe64\python36\lib\site-packages\pip (python 3.6)
> .\pip.exe install pandas
Collecting pandas
  Using cached https://files.pythonhosted.org/packages/79/87/8bb36bd4ebae147612c73d1bdc1385db7beebb9eb141c4bfefb33f52c87c/pandas-1.1.5-cp36-cp36m-win_amd64.whl
...
Successfully installed numpy-1.19.5 pandas-1.1.5 python-dateutil-2.8.2

Hopefully, you have Flac3D700 or higher since Flac3D500 and 600 raise a Command "python setup.py egg_info" failed with error code 1 error when following the same procedure. I could’nt find a way to bypass this, and am not sure whether it is a Python version problem (2.7 not supported anymore), a Python wrapping problem, or something else.

See you!

Théophile

1 Like

@Theophile
Thanks for the suggestion, but unfortunately it is not related to the path variables and throws the same error when trying to simply call the pip.exe from the directory itself:

@markus
Hum, this is unexpected!
Not sure about this one, but you can also try pointing directly to the Python in the parent folder:

> cd C:\Program Files\Itasca\ItascaSoftware900\exe64\python310
> .\python.exe -m pip --version

If this does not work either, you may want to have a look in your path environment variable and add those if not only present:
C:\Program Files\Itasca\ItascaSoftware900\exe64\python310
C:\Program Files\Itasca\ItascaSoftware900\exe64\python310\Scripts

Also, remove the C:\mypython310\python.exe if present and not necessary in your case.

Hope it helps.

1 Like

@Theophile Running directly from the python in the parent folder worked! So thank you very much. :slight_smile: I’m still not sure whether there is a misconfiguration in FLAC3D or just a problem on my PC. Will try on a different machine to see if the same problem occurs.

Hi @markus !

I’m glad it did the trick.
Now, you can harness the power of Python within FLAC3D ! :wink:

Cheers.

Théophile

Otherwise, the best way to import packages is to use the following command on cmd:

pip install “your_package” --target=“C:\Program Files\Itasca\ItascaSoftware900\exe64\python310\Lib”

Make sure you have admin privileges on cmd, replace “your_pachage” with the module you want to add. Make sure the default path is the correct location of your ItascaSofware directory (it will be different if you have version 7.0), and you’re good to go.

Best,
Rodrigo

1 Like

Awesome! Thanks a lot!