question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue running gateway.py

See original GitHub issue

I feel like I’m getting closer!

Now I’m hitting a message when running the line sudo ./gateway.py. This is the output:

(.venv) pi@BTGateway:~/bt-mqtt-gateway $ sudo ./gateway.py
Traceback (most recent call last):
  File "./gateway.py", line 11, in <module>
    import logger
  File "/home/pi/bt-mqtt-gateway/logger.py", line 3, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

It’s that last line that bothers me. Anyone got any ideas if this is normal or something I need to concern myself with? And if it’s the latter, what’s the fix?

Sorry again, complete Linux noob just trying to get bluetooth stuff working!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
thallaacommented, Aug 19, 2020

I ran into this very same problem. I ended up removing all of the VENV-parts from the service.sh and then it runs fine. So my service.sh looks like this:

#!/bin/sh
set -e
SCRIPT_DIR=$( cd "$( dirname "$0" )" >/dev/null 2>&1 && pwd )
cd "$SCRIPT_DIR"
python3 ./gateway.py "$@"

Perhaps someone handy with venv could point out how to do this with it but I’m happy with this now.

0reactions
Bottesfordcommented, May 4, 2020

I have the same problem. Seems we must run with sudo or I get: bluepy.btle.BTLEManagementError: Failed to execute management command ‘le on’ (code: 20, error: Permission Denied)

Do I really need to install everything as sudo? That doesn’t seem right to me having set it up in a venv.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gateway error when running the bot. #8215 - GitHub
Summary The bot was working all fine until an hour ago it started failing, my bot is in 267 servers right now and...
Read more >
Python Gateway Issue | Power BI Exchange
Hello everyone,Does anyone have any information regarding configuring python code inside Gateway.I have a PBIX in which I have Python code.
Read more >
Pyspark: Exception: Java gateway process exited before ...
One possible reason is JAVA_HOME is not set because java is not installed. I encountered the same issue. It says. Exception in thread...
Read more >
Python personal gateway credentials, A problem occ...
I was trying to schedule the refresh of power bi report, but got an error concerning invalid credentials (Your data source can't be...
Read more >
After update Home Assistant, Error connecting to deCONZ ...
I'm hassio running in a virtual machine and using deCONZ as intergration. ... Home assistant can't connect to the deconz gateway anymo…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found