Fix: “Copilot is not available in your location” GitHub Issue

Is the copilot not available when using GitHub Copilot in Visual Studio Code? In some cases, the on-screen message states that GitHub Copilot is unavailable in your location, while in others, it indicates unavailability in your region. This error prevents them from using GitHub Copilot at all. This issue transpires in both Visual Studio Code and Visual Studio.

What is GitHub Copilot?

GitHub Copilot is an AI pair programmer that helps users write code a lot faster and easier, making suggestions with individual lines and whole functions instantly. This AI tool is an extension for Visual Studio Code, Visual Studio, and more, and can provide suggestions for numerous languages and frameworks like Python, JavaScript, TypeScript, C#, C++, and more.

What causes this issue?

In most cases, this issue appears after an update has been installed. That means that the update might’ve come with a few errors. It might also be caused by the fact that you were signed out of your account, or your subscription has expired.

The cause might also be a file problem, which affects the program and doesn’t let it run properly. Files can become corrupted after using the program for some time, or after installing an update.

This issue can occur due to Visual Studio Code, which, in some situations, requires administrator privileges to function properly. VSCode might also have some files that are affecting you.

How can I fix this issue?

To fix this issue, there are a few things that you can do that are related to the program. These methods are easy to follow and will fix your issue. Here is how you can fix the Copilot is Not Available issue:

1. Make sure that you are signed in and subscribed

You need to start by making sure that you are signed in. This issue could appear when you’ve been logged out of your account. This can happen when you haven’t used the tool for some time and the login has expired, or if you haven’t saved your login information.

To verify if you are signed into your GitHub Copilot account, click on your profile picture located in the bottom left side of your Visual Studio Code screen. You will be able to see if you are logged in or not. If not, click on the Sign in button from the upper side and enter your credentials.

Looking if you are still logged in or not
Looking if you are still logged in or not

Besides this, you should also verify if your subscription is still active and if you haven’t missed a payment. This error could appear if the subscription has expired. Go to the Settings and access the Billing section. You will be able to see the current status of your account.

If you are logged in and the subscription is active but you still can’t use the GitHub Copilot, the cause for this issue is something else.

2. Reinstall an older version of GitHub Copilot

You should also try to install an older version of GitHub Copilot to see if that will fix your issue. This issue might’ve appeared after installing the latest update, meaning that the update came with some issues that are affecting you.

You can simply do this from the extension tab. Access GitHub Copilot and install the older version, then restart the app to ensure that the changes have been applied.

Here is how you can do this:

  1. Start by accessing the GitHub Copilot first page.
  2. Now you will be able to see the Uninstall button. Click on the error next to it to extend the drop-down menu.
  3. Click on the Install Another Version button.
    Installing an older version of GitHub Copilot
    Installing an older version of GitHub Copilot
  4. Choose the version that you’ve used before the current update and install it.
  5. Once the version has been installed, you need to restart the Visual Studio Code. Click on the Reload Required button and VSCode will restart automatically.
    Restarting Visual Studio Code
    Restarting Visual Studio Code
  6. Once VSCode has been reloaded completely, test it to see if the error has been fixed.

3. Update Visual Studio Code and reload it

Another factor that might cause your GitHub Copilot to not work is the Visual Studio Code being outdated. When an update for VSCode appears, you should install it as fast as you can to avoid issues like this one.

It was reported by many users that this issue is most likely caused by the fact that the Visual Studio Code is outdated. If that is the case, many other errors could appear because the extension is optimized for the latest version of VSCode.

All you have to do is to open the Visual Studio Code and check for updates. Install them and restart the application.

Here are the steps on how to do this:

  1. Start by opening the Visual Studio Code.
  2. Click on the Settings(gear icon) button located at the bottom left side.
  3. Now you need to click on the Check for Updates button. The scan will let you know if there are updates available or not.
    Checking for updates
    Checking for updates
  4. If there are updates available, wait until the installation is complete.
  5. After the update is installed, the last thing you need to do is to restart the Visual Studio Code.
  6. When it restarts completely, test it to see if the GitHub Copilot is still unavailable.

4. Enable Copilot Globally (Visual Studio only)

You should also ensure that the GitHub Copilot is enabled from the Visual Studio settings. This issue can appear when the Copilot is not enabled from the settings.

This can happen when you’ve manually disabled this setting, or when some issues have done it. All you need to do is go to Visual Studio and access the Settings of your GitHub Copilot, where you can enable it.

Note: Before going to the guide, you must know that these steps are only for Visual Studio users. If you are using Visual Studio Code, go to the last method.

Here is a guide that will show you how to do this:

  1. While you are inside Visual Studio, click on the Tools button from the upper side of the screen.
  2. Now open the Options.
    Opening the Visual Studio options
    Opening the Visual Studio options
  3. Look inside the left-sided list for GitHub. When you see it, click on it and access the Copilot options.
  4. Under the General section, you will be able to see the Enable Globally setting. Make sure that it is set to True for the GitHub Copilot to be enabled.
    Enabling the GitHub Copilot globally
    Enabling the GitHub Copilot globally
  5. Click on OK to save the changes and test Visual Studio to see if the Copilot is still unavailable.

5. Open Visual Studio Code as an administrator

The GitHub Copilot is an unavailable issue might be also caused by the lack of administrator privileges. To be able to work properly, you should give permission to Visual Studio Code to use all the files that it needs. This way it will be able to use the features and extensions that you want.

Some extensions in VS Code, like GitHub Copilot, require elevated permissions to access certain system resources or perform specific tasks. Running VS Code as an administrator ensures that you won’t encounter permission issues.

To simply run the program as an administrator, all you need to do is right-click on the Visual Studio Code icon and click on Run as administrator. You will then be prompted by the User Account Control. Confirm that you give permission to it by clicking on Yes.

Running Visual Studio Code as an administrator
Running Visual Studio Code as an administrator

If you see that you are now able to use the GitHub Copilot properly, you can set the program to always run as an administrator without repeating this process every time.

You need to right-click on the VSCode icon and click on Properties. Go to the Compatibility section and look inside the Settings tab. Click on the box associated with Run this program as an administrator. Click on Apply to save the changes and OK to close the Properties.

Running VSCode as an administrator
Running VSCode as an administrator

Now test again to see if the issue is not appearing anymore.

ABOUT THE AUTHOR

Abdul Mannan


Mannan is an aspiring Computer Scientist interested in AI and is currently an author at LinuxHint contributing as an AWS Expert.