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.

__init.py__ assumes sudo available on install

See original GitHub issue

In __init.py__, sudo is called to generate a machine-id in Linux environments. This causes issues on environments where sudo isn’t installed, as well as being a potentially unnecessary escalation of privileges

https://github.com/streamlit/streamlit/blob/develop/lib/streamlit/__init__.py#L67-L74

Ref: https://stackoverflow.com/questions/61871050/filenotfounderror-errno-2-no-such-file-or-directory-sudo-sudo

https://discuss.streamlit.io/t/streamlit-installation-in-pydroid3-android-app/3501

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mAch17commented, Apr 1, 2022

Hi,

This problem emerged for me in production today. The same codebase has been running for over 6 months and the streamlit version has been constant. The deployment runs streamlit within docker.

library version : streamlit==0.87.0

Error log :

File “/usr/local/lib/python3.8/site-packages/streamlit/script_runner.py”, line 172, in _process_request_queue self._run_script(data) File “/usr/local/lib/python3.8/site-packages/streamlit/script_runner.py”, line 272, in _run_script self.on_event.send(ScriptRunnerEvent.SCRIPT_STARTED) File “/usr/local/lib/python3.8/site-packages/blinker/base.py”, line 266, in send return [(receiver, receiver(sender, **kwargs)) File “/usr/local/lib/python3.8/site-packages/blinker/base.py”, line 266, in <listcomp> return [(receiver, receiver(sender, **kwargs)) File “/usr/local/lib/python3.8/site-packages/streamlit/report_session.py”, line 285, in _on_scriptrunner_event self._enqueue_new_report_message() File “/usr/local/lib/python3.8/site-packages/streamlit/report_session.py”, line 383, in _enqueue_new_report_message _populate_user_info_msg(imsg.user_info) File “/usr/local/lib/python3.8/site-packages/streamlit/report_session.py”, line 706, in _populate_user_info_msg msg.installation_id = Installation.instance().installation_id File “/usr/local/lib/python3.8/site-packages/streamlit/metrics_util.py”, line 129, in instance cls._instance = Installation() File “/usr/local/lib/python3.8/site-packages/streamlit/metrics_util.py”, line 133, in init self.installation_id_v1 = str(uuid.uuid5(uuid.NAMESPACE_DNS, _get_machine_id())) File “/usr/local/lib/python3.8/site-packages/streamlit/metrics_util.py”, line 49, in _get_machine_id subprocess.run([“sudo”, “dbus-uuidgen”, “–ensure”]) File “/usr/local/lib/python3.8/subprocess.py”, line 493, in run with Popen(*popenargs, **kwargs) as process: File “/usr/local/lib/python3.8/subprocess.py”, line 858, in init self._execute_child(args, executable, preexec_fn, close_fds, File “/usr/local/lib/python3.8/subprocess.py”, line 1704, in _execute_child

0reactions
randyzwitchcommented, Apr 1, 2022

Hi @mAch17 -

We don’t have any way of going back in time to change older versions, so if you’re going to use 0.87 then I think you’ll continue to have this problem. Streamlit is on version 1.8.1 at this point, so I’d suggest you update and this issue should no longer be a problem.

Best, Randy

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - What is __init__.py for? - Stack Overflow
It indicates that the directory should be regarded as a package. Of course, __init__.py can also set the appropriate content. If we add...
Read more >
Understanding Python imports, __init__.py and pythonpath
In the essence of keeping things simple, let's first create a single directory scripts within our project directory and add two modules to...
Read more >
A Practical Guide to Using Setup.py - GoDataDriven
pip install -e . The . here refers to the current working directory, which I assume to be the directory where the setup.py...
Read more >
Is it considered as bad practice to have code on the __init__.py?
I think you are missing an important piece here that I personally found a little confusing when I first encountered it: packages in...
Read more >
Step 1: Configure pymssql environment - Python driver for ...
Step 1 of this getting started guide involves installing Python, ... --assume-yes install python-dev python-pip > sudo pip install pymssql ...
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