How to fix bash command not found error in DALL-E tutorial

Leabriah Spencer 45 Reputation points
2023-10-30T16:45:12.5633333+00:00

Trying to follow along the tutorial https://microsoftlearning.github.io/mslearn-openai/Instructions/Labs/05-generate-images.html

but when I try to run the code at the end I receive this error:

"bash: generate-image.py: command not found"

Also: "chmod +x generate-image.py" command didnt resolve my issue.

Any feedback is helpful. Thank you.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,361 questions
{count} votes

Accepted answer
  1. dupammi 8,535 Reputation points Microsoft Vendor
    2023-10-30T17:26:07.2633333+00:00

    Hi @Leabriah Spencer ,

    Thank you for using Microsoft Q&A.

    Below is the error that I was able to repro at my end:

    dupammi [ ~/azure-openai/Labfiles/05-image-generation/Python ]$ generate-image.py
    bash: generate-image.py: command not found
    

    Instead of above command, please use below command:

    dupammi [ ~/azure-openai/Labfiles/05-image-generation/Python ]$ python generate-image.py
    

    Command : python generate-image.py

    It gives you a prompt like below.

    Enter a prompt to request an image: 
    

    Hope this helps. Thanks!


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2023-10-30T16:45:12.57+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To fix the "bash: generate-image.py: command not found" error in the DALL-E tutorial, you need to make sure that the file has executable permissions. You can do this by running the following command in your terminal:

    chmod +x generate-image.py
    

    This will give the file executable permissions, allowing you to run it as a command.


    References:

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.