0

Environment:

Python 3.8

Mac OS X High Sierra 10.13.6

Problem:

When I open my terminal in my macbook and I run this command:

user$sdk version

I get no issue and I can see version number of sdkman:

SDKMAN 5.9.0+555

But if I try to do the same from my Python 3.8 script, I get an error output:

command_sdkman_version_0='sdk version'
os.system(command_sdkman_version_0)


sh: sdk: command not found

When I print the PATH environment variable from terminal and from the script, they are both the same.

When I use 'sudo sdk version', I have same issue.

What is wrong?

Gauthier Buttez
  • 1,005
  • 1
  • 16
  • 40

1 Answers1

0

I had the same issue but using a shell script. For me the fix was that when running the script instead of using ./scriptName.sh i had to use . ./scriptName.sh

For a more detailed explication please see the fallowing post: How to execute bash script in same shell

Sebastian
  • 1
  • 1