[GH-ISSUE #4940] Can't run ollama using cmd on Windows #28883

Closed
opened 2026-04-22 07:26:16 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @davyd-ziarmand on GitHub (Jun 9, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4940

What is the issue?

I can't run ollama using windows 11 terminal app:

image

But environment variable exists in "System variables":

image

OS

Windows

GPU

Nvidia

CPU

Intel

Ollama version

No response

Originally created by @davyd-ziarmand on GitHub (Jun 9, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4940 ### What is the issue? I can't run ollama using windows 11 terminal app: ![image](https://github.com/ollama/ollama/assets/30569343/9daecf0f-8662-48cb-8c5c-c00bcbb7fb5b) But environment variable exists in "System variables": ![image](https://github.com/ollama/ollama/assets/30569343/de540c41-8133-408f-ad80-5c5e8d095114) ### OS Windows ### GPU Nvidia ### CPU Intel ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-22 07:26:16 -05:00
Author
Owner

@davyd-ziarmand commented on GitHub (Jun 9, 2024):

idk why, but it fixed when I discovered ollama.exe file was not present in C:\Users\MY_USER\AppData\Local\Programs\Ollama location. I asked in ollama discord to share this file with me. Copied it to this folder and it started work. Before that I tried: multiple restarts of laptop, reinstalls of ollama - nothing of this helped.

<!-- gh-comment-id:2156655026 --> @davyd-ziarmand commented on GitHub (Jun 9, 2024): idk why, but it fixed when I discovered ollama.exe file was not present in C:\Users\MY_USER\AppData\Local\Programs\Ollama location. I asked in ollama discord to share this file with me. Copied it to this folder and it started work. Before that I tried: multiple restarts of laptop, reinstalls of ollama - nothing of this helped.
Author
Owner

@s-andrianov commented on GitHub (Feb 10, 2025):

So where can i get this file?

<!-- gh-comment-id:2649082781 --> @s-andrianov commented on GitHub (Feb 10, 2025): So where can i get this file?
Author
Owner

@Azkreg commented on GitHub (Feb 13, 2025):

I fixed mine like this:
if anyone is still encountering the issue even though they added it to the system variables, open a terminal (admin) and add it to the system variables with this command:

setx /M PATH "%PATH%;C:\Users\USER\AppData\Local\Programs\Ollama"

(don't forget to change the directory with your own.)
Open a new terminal and it should work

<!-- gh-comment-id:2655199893 --> @Azkreg commented on GitHub (Feb 13, 2025): I fixed mine like this: if anyone is still encountering the issue even though they added it to the system variables, open a terminal (admin) and add it to the system variables with this command: setx /M PATH "%PATH%;C:\Users\USER\AppData\Local\Programs\Ollama" (don't forget to change the directory with your own.) Open a new terminal and it should work
Author
Owner

@maximbroos commented on GitHub (Apr 9, 2025):

I ran the windows installer as an administrator and it worked?

<!-- gh-comment-id:2788836349 --> @maximbroos commented on GitHub (Apr 9, 2025): I ran the windows installer as an administrator and it worked?
Author
Owner

@davyd-ziarmand commented on GitHub (Apr 12, 2025):

I just needed to add variable to windows PATH

I ran the windows installer as an administrator and it worked?

<!-- gh-comment-id:2798781756 --> @davyd-ziarmand commented on GitHub (Apr 12, 2025): I just needed to add variable to windows PATH > I ran the windows installer as an administrator and it worked?
Author
Owner

@shoryajain300 commented on GitHub (Aug 11, 2025):

Doing this "setx /M PATH "%PATH%;C:\Users\USER\AppData\Local\Programs\Ollama" caused my entire system variables to be erased.

<!-- gh-comment-id:3175930773 --> @shoryajain300 commented on GitHub (Aug 11, 2025): Doing this "setx /M PATH "%PATH%;C:\Users\USER\AppData\Local\Programs\Ollama" caused my entire system variables to be erased.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#28883