Question: For some reason I'm getting this error:

> 
> Uncaught ReferenceError: $stateProvider is not defined
> 
> 
> 

even though `angular-ui-router.js` is being loaded fine.

Here is my code 

```
(function () {
    var mod = angular.module('MyApp', ['ui.router']);
    debugger;
    mod.config(['$stateProvider', '$locationProvider', function ($stateProvider, $locationProvider) {
        $stateProvider.state('product', {
            url: "/home/product",
            views: {
                "view1": {
                    templateUrl: "/Angular/Components/Products/Products.html",
                    controller: "Ctr_Products",
                }
            }
        });

    $locationProvider.html5Mode({
        enabled: true, requireBase: false
    });
}]);

```

Answer: 
This is likely because you switched python versions in a weird way. Do you have `/usr/lib/python3/dist-packages/apt_pkg.so` ? This can be missing if you removed a version of python.

The answer that worked for me was this from [askubuntu forums](https://askubuntu.com/questions/1069087/modulenotfounderror-no-module-named-apt-pkg-error?noredirect=1&lq=1):

```
ln -s /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so /usr/lib/python3/dist-packages/apt_pkg.so

```
Install python-dev module for specific version of python:

```
sudo apt install python3.6-dev

```