Set pythonpath in Github Actions, running on Ubuntu. #25010
-
I am relying on modules in my project for which I would like to set append a PYTHONPATH. Working locally I would do it like this and it works.
However, the same approach for Github Actions throws the error:
my_workflow.yml
pwd returns
I have tried to to set the PYTHONPATH to both
and the above, with no luck. Please help! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Each step in actions runs in its own process so exporting in a shell is not going to translate across steps. To update the path for a downstream step you need to use the add-path workflow command https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path. |
Beta Was this translation helpful? Give feedback.
-
command: echo “::add-path::/path/to/dir” will pepend a directory to the system PATH variable for all subsequent actions in the current job. But look at your code, are you searching ‘set-env’?
|
Beta Was this translation helpful? Give feedback.
-
Hello i keep having the same error. can you give me a step by set on how i solve this. |
Beta Was this translation helpful? Give feedback.
-
The set-env and add-path commands are deprecated in git, you can’t use them anymore.
|
Beta Was this translation helpful? Give feedback.
command: echo “::add-path::/path/to/dir” will pepend a directory to the system PATH variable for all subsequent actions in the current job. But look at your code, are you searching ‘set-env’?