Happy #MapInfoMonday!
Last week I was asked how you can install additional modules to be used from Python inside MapInfo Pro, specifically the requests
module. The question came from @Sean Stephen.
This is of course possible and once you know it, it's also quite easy to do. It's also one of those things I rarely do, so I tend to forget it in between the times I do it.
1. From Windows Explorer go to the Python310 folder in your MapInfo Pro installation folder and double-click on the file prompt.bat.
The default path to the MapInfo Pro installation folder is C:\Program Files\MapInfo\Professional
.
You need administrative permissions so it may be necessary to launch the prompt.bat as administrator. If so, right-click on the file and choose Run as Administrator. And that may not even be enough if you are logged in without enough credentials.
If you are using a different version of MapInfo Pro than v2023, the folder may be named differently depending on the version of Python we deploy with MapInfo Pro.
2. If the Command Prompt doesn't start in the Python310 folder in your MapInfo Pro installation folder, use the cd
command to navigate there.
This is typically the case when you use Run As Administrator.
3. You can now use pip to download and install additional Python modules.
The command looks like this: python -m pip install <module name>
4. The requested module will now be downloaded and installed if it is available.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------