Import python library

kdpk
New Contributor II

Hello , 

I've got problem with python script ,  first line of script have command to import :

import os.path ,os , getpass

but Jamf PRO have problem like below:
line 1: import: command not found

Do you have some tips how to solve it ? 

1 ACCEPTED SOLUTION

sdagley
Esteemed Contributor II

@kdpk If your script is Python it must start with a #! line with a path to the Python interpreter installation on your Mac (Python is no longer installed by default)

The MacAdmins Python package is a good place to start if you don't already have a preferred Python distro: https://github.com/macadmins/python

View solution in original post

2 REPLIES 2

sdagley
Esteemed Contributor II

@kdpk If your script is Python it must start with a #! line with a path to the Python interpreter installation on your Mac (Python is no longer installed by default)

The MacAdmins Python package is a good place to start if you don't already have a preferred Python distro: https://github.com/macadmins/python

Loycefort
New Contributor
  1. Save this code in a file named mymodule.py. ...
  2. Import the module named mymodule, and call the greeting function: ...
  3. Save this code in the file mymodule.py. ...
  4. Import the module named mymodule, and access the person1 dictionary: ...
  5. Create an alias for mymodule called mx : ...
  6. Import and use the platform module: fusd atlas