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?

1
  • Try using the full path to sdk. Commented Aug 24, 2020 at 20:55

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.