# Emoncms on Ubuntu 20.04 with scripts

**URL:** <https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048>\
**Category:** Emoncms\
**Tags:** export, backup\
**Created:** [11 August 2020 12:59 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048 "2020-08-11T12:59:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [11 August 2020 12:59 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/1 "2020-08-11T12:59:11Z")

</div>

Hi, I have installed Emoncms using the scripts on Ubuntu.

The backup export function doesn’t work when I press the button. The log window also don’t display any information.

Any advice?

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 August 2020 13:01 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/2 "2020-08-11T13:01:10Z")

</div>

I hit this problem before. I think it might be permissions.

Did you add a user, then install as that user?

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [11 August 2020 13:04 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/3 "2020-08-11T13:04:30Z")

</div>

The installation script did ask for a Pi user and then it stopped, I went back and added my user in the config file then rerun the script

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 August 2020 13:05 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/4 "2020-08-11T13:05:47Z")

</div>

Ah, but did you install when logged in as that user?

Is the service `service-runner` running?

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [11 August 2020 13:07 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/5 "2020-08-11T13:07:51Z")

</div>

I had to install the service-runner manually, its running now.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 August 2020 13:08 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/6 "2020-08-11T13:08:25Z")

</div>

That isn’t good news. Why and how?

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [11 August 2020 13:11 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/7 "2020-08-11T13:11:45Z")

</div>

I followed these steps to get it working.

> <https://github.com/emoncms/emoncms/blob/master/scripts/services/install-service-runner-update.md>

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 August 2020 13:18 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/8 "2020-08-11T13:18:31Z")

</div>

That isn’t good as those are old instructions and the emonscripts do things differently.

I think your issue is the same as here that I’m not sure has been fixed. All you needed to do was edit the drop-in.

> <https://github.com/openenergymonitor/EmonScripts/issues/80#issuecomment-649133745>
>
> Hi @TrystanLea Just installed on an Ubuntu system. had an error because of hardc…oded user name so tried again with the user pi created.
> 
> \### 1. No log window
> 
> !\[image\](https://user-images.githubusercontent.com/1322749/75611997-6bd94d00-5b17-11ea-8c49-a2829eb8845b.png)
> 
> \### 2. ~~Demandshaper not in menu~~
> 
> Just realised it has moved 🤦‍♂ 
> 
> \### 3. Dashboards not imported
> 
> \### 4. Cannot create new dashboards

My suggestion is to start again, trying to fix what you have done will probably take longer, update will not like it etc.

Happy to help as we need to fix the scripts.

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [11 August 2020 13:54 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/9 "2020-08-11T13:54:15Z")

</div>

Thanks, its very possibly the issue, I will restart my installation. Can you please direct me to the file location to edit the drop-in when I reinstall?

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 August 2020 14:01 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/10 "2020-08-11T14:01:06Z")

</div>

Yes. I suggest you have a read through that issue on GitHub. I think we decided that there were also issues around permissions of the Modules folder.

TBH, the simplest way is to create a user ‘pi’ and use that!

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [11 August 2020 17:21 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/11 "2020-08-11T17:21:55Z")

</div>

Done a fresh Ubuntu server installation, only created “pi” username.  
Updated the config.ini file to change the non-pi environment.  
Ran the install ./main.sh script, but the service-running did not start

I noticed that the /usr/bin/python directory does not exist.

```auto
pi@emoncms:/opt/openenergymonitor/EmonScripts/install$ journalctl -f -u service-runner
-- Logs begin at Tue 2020-08-11 15:23:57 UTC. --
Aug 11 16:39:45 emoncms systemd[2647]: service-runner.service: Failed at step EXEC spawning /usr/bin/python: No such file or directory
Aug 11 16:39:45 emoncms systemd[1]: service-runner.service: Main process exited, code=exited, status=203/EXEC
Aug 11 16:39:45 emoncms systemd[1]: service-runner.service: Failed with result 'exit-code'.
Aug 11 16:40:16 emoncms systemd[1]: service-runner.service: Scheduled restart job, restart counter is at 101.
Aug 11 16:40:16 emoncms systemd[1]: Stopped Emoncms service-runner Input Script.
Aug 11 16:40:16 emoncms systemd[1]: Started Emoncms service-runner Input Script.
Aug 11 16:40:16 emoncms systemd[2661]: service-runner.service: Failed to execute command: No such file or directory
Aug 11 16:40:16 emoncms systemd[2661]: service-runner.service: Failed at step EXEC spawning /usr/bin/python: No such file or directory
Aug 11 16:40:16 emoncms systemd[1]: service-runner.service: Main process exited, code=exited, status=203/EXEC
Aug 11 16:40:16 emoncms systemd[1]: service-runner.service: Failed with result 'exit-code'.
    indent preformatted text by 4 spaces

```

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [11 August 2020 21:30 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/12 "2020-08-11T21:30:53Z")

</div>

For future reference, when posting code or bash output, put in 3 ‘backticks’ (found at the top left of the keyboard [normally](https://superuser.com/questions/254076/how-do-i-type-the-tick-and-backtick-characters-on-windows/254077#254077)) on a line on their own, then the code, then 3 more backticks on a line following the code.

````auto
    ```
    code
    ```

````

If it is something like php you can add a language identifier that after the first 3 backticks so ````php`

What is the result of

```auto
which python

```

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [12 August 2020 05:30 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/13 "2020-08-12T05:30:51Z")

</div>

I got no results from the command, but it would seem like Python 3.8.2 is installed but it does not have a reference to “python” and had to use “python3”

```auto
pi@emoncms:/$ which python
pi@emoncms:/$
pi@emoncms:/$ python

Command 'python' not found, did you mean:

  command 'python3' from deb python3
  command 'python' from deb python-is-python3

pi@emoncms:/$ python3
Python 3.8.2 (default, Jul 16 2020, 14:00:26)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

```

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [12 August 2020 06:26 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/14 "2020-08-12T06:26:21Z")

</div>

`service-runner` needs Python as opposed to Python3 (still - I’ve raised an issue). I think this must either be installed by default on the Pi, or it just so happened that service runner was picking it up on the back of it being installed for another purpose (when other modules used python).

What also might have happened is Ubuntu have changed the install as python2.x is EOL.

To check what is installed can you please run

```auto
apt list --installed pytho*

```

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [12 August 2020 06:28 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/15 "2020-08-12T06:28:41Z")

</div>

See output

```auto
pi@emoncms:~$ apt list --installed pytho*
Listing... Done
python-apt-common/focal-updates,now 2.0.0ubuntu0.20.04.1 all [installed,automatic]
python3-apport/focal-updates,focal-security,now 2.20.11-0ubuntu27.6 all [installed,automatic]
python3-apt/focal-updates,now 2.0.0ubuntu0.20.04.1 amd64 [installed,automatic]
python3-attr/focal,now 19.3.0-2 all [installed,automatic]
python3-automat/focal,now 0.8.0-1ubuntu1 all [installed,automatic]
python3-blinker/focal,now 1.4+dfsg1-0.3ubuntu1 all [installed,automatic]
python3-certifi/focal,now 2019.11.28-1 all [installed,automatic]
python3-cffi-backend/focal,now 1.14.0-1build1 amd64 [installed,automatic]
python3-chardet/focal,now 3.0.4-4build1 all [installed,automatic]
python3-click/focal,now 7.0-3 all [installed,automatic]
python3-colorama/focal,now 0.4.3-1build1 all [installed,automatic]
python3-commandnotfound/focal,now 20.04.2 all [installed,automatic]
python3-configobj/focal,now 5.0.6-4 all [installed,automatic]
python3-constantly/focal,now 15.1.0-1build1 all [installed,automatic]
python3-cryptography/focal,now 2.8-3 amd64 [installed,automatic]
python3-dbus/focal,now 1.2.16-1build1 amd64 [installed,automatic]
python3-debconf/focal,now 1.5.73 all [installed,automatic]
python3-debian/focal,now 0.1.36ubuntu1 all [installed,automatic]
python3-distro-info/focal,now 0.23ubuntu1 all [installed,automatic]
python3-distro/focal,now 1.4.0-1 all [installed,automatic]
python3-distupgrade/focal-updates,now 1:20.04.23 all [installed,automatic]
python3-distutils/focal,now 3.8.2-1ubuntu1 all [installed,automatic]
python3-entrypoints/focal,now 0.3-2ubuntu1 all [installed,automatic]
python3-gdbm/focal,now 3.8.2-1ubuntu1 amd64 [installed,automatic]
python3-gi/focal,now 3.36.0-1 amd64 [installed,automatic]
python3-hamcrest/focal,now 1.9.0-3 all [installed,automatic]
python3-httplib2/focal,now 0.14.0-1ubuntu1 all [installed,automatic]
python3-hyperlink/focal,now 19.0.0-1 all [installed,automatic]
python3-idna/focal,now 2.8-1 all [installed,automatic]
python3-importlib-metadata/focal,now 1.5.0-1 all [installed,automatic]
python3-incremental/focal,now 16.10.1-3.2 all [installed,automatic]
python3-jinja2/focal,now 2.10.1-2 all [installed,automatic]
python3-json-pointer/focal,now 2.0-0ubuntu1 all [installed,automatic]
python3-jsonpatch/focal,now 1.23-3 all [installed,automatic]
python3-jsonschema/focal,now 3.2.0-0ubuntu2 all [installed,automatic]
python3-jwt/focal,now 1.7.1-2ubuntu2 all [installed,automatic]
python3-keyring/focal,now 18.0.1-2ubuntu1 all [installed,automatic]
python3-launchpadlib/focal,now 1.10.13-1 all [installed,automatic]
python3-lazr.restfulclient/focal,now 0.14.2-2build1 all [installed,automatic]
python3-lazr.uri/focal,now 1.0.3-4build1 all [installed,automatic]
python3-lib2to3/focal,now 3.8.2-1ubuntu1 all [installed,automatic]
python3-markupsafe/focal,now 1.1.0-1build2 amd64 [installed,automatic]
python3-minimal/focal,now 3.8.2-0ubuntu2 amd64 [installed,automatic]
python3-more-itertools/focal,now 4.2.0-1build1 all [installed,automatic]
python3-nacl/focal,now 1.3.0-5 amd64 [installed]
python3-netifaces/focal,now 0.10.4-1ubuntu4 amd64 [installed,automatic]
python3-newt/focal,now 0.52.21-4ubuntu2 amd64 [installed,automatic]
python3-oauthlib/focal,now 3.1.0-1ubuntu2 all [installed,automatic]
python3-openssl/focal,now 19.0.0-1build1 all [installed,automatic]
python3-pkg-resources/focal,now 45.2.0-1 all [installed,automatic]
python3-problem-report/focal-updates,focal-security,now 2.20.11-0ubuntu27.6 all [installed,automatic]
python3-pyasn1-modules/focal,now 0.2.1-0.2build1 all [installed,automatic]
python3-pyasn1/focal,now 0.4.2-3build1 all [installed,automatic]
python3-pymacaroons/focal,now 0.13.0-3 all [installed]
python3-pyrsistent/focal,now 0.15.5-1build1 amd64 [installed,automatic]
python3-requests-unixsocket/focal,now 0.2.0-2 all [installed,automatic]
python3-requests/focal,now 2.22.0-2ubuntu1 all [installed,automatic]
python3-secretstorage/focal,now 2.3.1-2ubuntu1 all [installed,automatic]
python3-serial/focal,now 3.4-5.1 all [installed,automatic]
python3-service-identity/focal,now 18.1.0-5build1 all [installed,automatic]
python3-setuptools/focal,now 45.2.0-1 all [installed,automatic]
python3-simplejson/focal,now 3.16.0-2ubuntu2 amd64 [installed,automatic]
python3-six/focal,now 1.14.0-2 all [installed,automatic]
python3-software-properties/focal-updates,now 0.98.9.1 all [installed,automatic]
python3-systemd/focal,now 234-3build2 amd64 [installed,automatic]
python3-twisted-bin/focal,now 18.9.0-11 amd64 [installed,automatic]
python3-twisted/focal,now 18.9.0-11 all [installed,automatic]
python3-update-manager/focal-updates,now 1:20.04.10.1 all [installed,automatic]
python3-urllib3/focal,now 1.25.8-2 all [installed,automatic]
python3-wadllib/focal,now 1.3.3-3build1 all [installed,automatic]
python3-yaml/focal,now 5.3.1-1 amd64 [installed,automatic]
python3-zipp/focal,now 1.0.0-1 all [installed,automatic]
python3-zope.interface/focal,now 4.7.1-1 amd64 [installed,automatic]
python3.8-minimal/focal-updates,focal-security,now 3.8.2-1ubuntu1.2 amd64 [installed,automatic]
python3.8/focal-updates,focal-security,now 3.8.2-1ubuntu1.2 amd64 [installed,automatic]
python3/focal,now 3.8.2-0ubuntu2 amd64 [installed,automatic]
pi@emoncms:~$

```

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [12 August 2020 06:33 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/17 "2020-08-12T06:33:02Z")

</div>

Yes so only python3.

Try

```auto
sudo apt-get install -y python-pip python-dev

```

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [12 August 2020 06:36 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/18 "2020-08-12T06:36:46Z")

</div>

See output

```auto
pi@emoncms:~$ sudo apt-get install -y python-pip python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'python-dev-is-python2' instead of 'python-dev'
E: Unable to locate package python-pip

```

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [12 August 2020 06:39 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/19 "2020-08-12T06:39:29Z")

</div>

Looks like Ubuntu have dropped python from the repos.

[edit]

**what does simply running `python` give you before you do below?**

Quick Google;

Try

```auto
sudo apt install python2

```

Check where is is with `which python`

---

<div class="post-metadata">

**Author:** ![Berten\_Du\_Bruyn](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/berten_du_bruyn/32/15015_2.png) [@Berten\_Du\_Bruyn](https://community.openenergymonitor.org/u/Berten_Du_Bruyn)\
**Post date:** [12 August 2020 06:45 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/20 "2020-08-12T06:45:26Z")

</div>

python2 installed, but see output.  
No output from `which python` also no reference to `python`

```auto
pi@emoncms:~$ which python
pi@emoncms:~$ python

Command 'python' not found, did you mean:

  command 'python3' from deb python3
  command 'python' from deb python-is-python3

pi@emoncms:~$ python2
Python 2.7.18rc1 (default, Apr 7 2020, 12:05:55)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

```

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [12 August 2020 06:49 UTC](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048/21 "2020-08-12T06:49:17Z")

</div>

What does `which python2` give you?

What Ubuntu version are you running (bit late to ask, but hey ho)?

[Next page](https://community.openenergymonitor.org/t/emoncms-on-ubuntu-20-04-with-scripts/15048.md?page=2)
