hello world difficulty
I feel like an idiot for having to ask for help so early, but I'm trying to get started with the hello world tutorial and ran into a problem very quickly. First off I want to say thank you for all the work that's been put into the tutorils. The amount of information in them is quite daunting, but considering the subject matter it's actually very accessible all things considered. I have a Debian 10 linux VM that I'm using for testing. I'm okay building a VM dedicated solely to seL4 development if that's necessary, but I'm assuming it's not. FYI I had some difficulty with the prerequisites instructions regarding Debian. This may be the source of the problem I'm having but I'm not sure how to resolve it. Your setup instructions said to refer to the docker requirements but when I went there I couldn't find anything on that page that indicated what exactly I was supposed to install. All that being said, here is a capture from my terminal which I'm hoping illustrates the problem I'm having specifically: rmitchell@ou812:~/sel4-tutorials-manifest$ ./init --tut hello-world Traceback (most recent call last): File "./init", line 16, in <module> import common File "/home/rmitchell/sel4-tutorials-manifest/projects/sel4-tutorials/common.py", line 16, in <module> import sh ModuleNotFoundError: No module named 'sh' rmitchell@ou812:~/sel4-tutorials-manifest$ python Python 3.9.1 (default, Mar 19 2021, 01:08:36) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
import sh sh.__version__ '1.14.1' exit()
As you can see from my example above, I have Python 3.9.1 installed and it is the default python interpreter on my system. The "sh" module is installed and accessible from Python's interactive interpreter, yet when the common.py file tries to import it, it complains that it can't find the 'sh' module. FYI sh is installed both at the system and user levels. I'll try digging into your source and see if I can figure out what the issue is. I'll share my findings if I figure it out before you guys point out my mistakes. Thanks! Royce Mitchell, IT Consultant ITAS Solutions royce3@itas-solutions.com There are three hard problems in computer science: naming things, and off-by-one errors.
Okay, instead of the following:
./init --tut hello_world
I tried the following:
python init --tut hello_world
That appears to have resolved the sh import issue and I know how to
troubleshoot the errors I'm getting now (obviously missing imports that I
still need to install).
I'm guessing that it has to do with the python interpreter path at the top
of init.py. However, I'm not a Linux expert so I'm not sure how to
recommend a change to that. It could be I set the default interpreter
incorrectly, though I did follow instructions I found by googling which
instructed me to use the "update-alternatives" command.
Royce Mitchell, IT Consultant
ITAS Solutions
royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and
off-by-one errors.
On Thu, Apr 8, 2021 at 12:23 AM Royce Mitchell III
I feel like an idiot for having to ask for help so early, but I'm trying to get started with the hello world tutorial and ran into a problem very quickly.
First off I want to say thank you for all the work that's been put into the tutorils. The amount of information in them is quite daunting, but considering the subject matter it's actually very accessible all things considered.
I have a Debian 10 linux VM that I'm using for testing. I'm okay building a VM dedicated solely to seL4 development if that's necessary, but I'm assuming it's not.
FYI I had some difficulty with the prerequisites instructions regarding Debian. This may be the source of the problem I'm having but I'm not sure how to resolve it. Your setup instructions said to refer to the docker requirements but when I went there I couldn't find anything on that page that indicated what exactly I was supposed to install.
All that being said, here is a capture from my terminal which I'm hoping illustrates the problem I'm having specifically:
rmitchell@ou812:~/sel4-tutorials-manifest$ ./init --tut hello-world Traceback (most recent call last): File "./init", line 16, in <module> import common File "/home/rmitchell/sel4-tutorials-manifest/projects/sel4-tutorials/common.py", line 16, in <module> import sh ModuleNotFoundError: No module named 'sh' rmitchell@ou812:~/sel4-tutorials-manifest$ python Python 3.9.1 (default, Mar 19 2021, 01:08:36) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
import sh sh.__version__ '1.14.1' exit()
As you can see from my example above, I have Python 3.9.1 installed and it is the default python interpreter on my system. The "sh" module is installed and accessible from Python's interactive interpreter, yet when the common.py file tries to import it, it complains that it can't find the 'sh' module. FYI sh is installed both at the system and user levels.
I'll try digging into your source and see if I can figure out what the issue is. I'll share my findings if I figure it out before you guys point out my mistakes.
Thanks! Royce Mitchell, IT Consultant ITAS Solutions royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and off-by-one errors.
okay for posterity, I updated the default "python" command to python 3.9
but your scripts are invoking the "python3" command. Once I used
update-alternatives to point the "python3" command to 3.9 I was able to
start making progress.
Royce Mitchell, IT Consultant
ITAS Solutions
royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and
off-by-one errors.
On Thu, Apr 8, 2021 at 12:34 AM Royce Mitchell III
Okay, instead of the following:
./init --tut hello_world
I tried the following:
python init --tut hello_world
That appears to have resolved the sh import issue and I know how to troubleshoot the errors I'm getting now (obviously missing imports that I still need to install).
I'm guessing that it has to do with the python interpreter path at the top of init.py. However, I'm not a Linux expert so I'm not sure how to recommend a change to that. It could be I set the default interpreter incorrectly, though I did follow instructions I found by googling which instructed me to use the "update-alternatives" command.
Royce Mitchell, IT Consultant ITAS Solutions royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and off-by-one errors.
On Thu, Apr 8, 2021 at 12:23 AM Royce Mitchell III
wrote: I feel like an idiot for having to ask for help so early, but I'm trying to get started with the hello world tutorial and ran into a problem very quickly.
First off I want to say thank you for all the work that's been put into the tutorils. The amount of information in them is quite daunting, but considering the subject matter it's actually very accessible all things considered.
I have a Debian 10 linux VM that I'm using for testing. I'm okay building a VM dedicated solely to seL4 development if that's necessary, but I'm assuming it's not.
FYI I had some difficulty with the prerequisites instructions regarding Debian. This may be the source of the problem I'm having but I'm not sure how to resolve it. Your setup instructions said to refer to the docker requirements but when I went there I couldn't find anything on that page that indicated what exactly I was supposed to install.
All that being said, here is a capture from my terminal which I'm hoping illustrates the problem I'm having specifically:
rmitchell@ou812:~/sel4-tutorials-manifest$ ./init --tut hello-world Traceback (most recent call last): File "./init", line 16, in <module> import common File "/home/rmitchell/sel4-tutorials-manifest/projects/sel4-tutorials/common.py", line 16, in <module> import sh ModuleNotFoundError: No module named 'sh' rmitchell@ou812:~/sel4-tutorials-manifest$ python Python 3.9.1 (default, Mar 19 2021, 01:08:36) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
import sh sh.__version__ '1.14.1' exit()
As you can see from my example above, I have Python 3.9.1 installed and it is the default python interpreter on my system. The "sh" module is installed and accessible from Python's interactive interpreter, yet when the common.py file tries to import it, it complains that it can't find the 'sh' module. FYI sh is installed both at the system and user levels.
I'll try digging into your source and see if I can figure out what the issue is. I'll share my findings if I figure it out before you guys point out my mistakes.
Thanks! Royce Mitchell, IT Consultant ITAS Solutions royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and off-by-one errors.
okay, last post on this topic.
I don't recommend changing python3 as it has broken many things about the
operating system that are not trivial to fix. lsb_release and even apt get
broken by this change.
it would be nice if there was a way to switch the sel4 tutorials to use
"python" instead of "python3" so that I could use the latest python without
causing upset in the operating system, however I'm just going to roll back
my default python3 command and use the builtin version to get this running,
since I assume I don't need the latest python to run your tutorials.
I have now finally successfully run the init command for hello world, off
to the races. Thanks for watching ;)
Royce Mitchell, IT Consultant
ITAS Solutions
royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and
off-by-one errors.
On Thu, Apr 8, 2021 at 12:59 AM Royce Mitchell III
okay for posterity, I updated the default "python" command to python 3.9 but your scripts are invoking the "python3" command. Once I used update-alternatives to point the "python3" command to 3.9 I was able to start making progress.
Royce Mitchell, IT Consultant ITAS Solutions royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and off-by-one errors.
On Thu, Apr 8, 2021 at 12:34 AM Royce Mitchell III
wrote: Okay, instead of the following:
./init --tut hello_world
I tried the following:
python init --tut hello_world
That appears to have resolved the sh import issue and I know how to troubleshoot the errors I'm getting now (obviously missing imports that I still need to install).
I'm guessing that it has to do with the python interpreter path at the top of init.py. However, I'm not a Linux expert so I'm not sure how to recommend a change to that. It could be I set the default interpreter incorrectly, though I did follow instructions I found by googling which instructed me to use the "update-alternatives" command.
Royce Mitchell, IT Consultant ITAS Solutions royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and off-by-one errors.
On Thu, Apr 8, 2021 at 12:23 AM Royce Mitchell III
wrote: I feel like an idiot for having to ask for help so early, but I'm trying to get started with the hello world tutorial and ran into a problem very quickly.
First off I want to say thank you for all the work that's been put into the tutorils. The amount of information in them is quite daunting, but considering the subject matter it's actually very accessible all things considered.
I have a Debian 10 linux VM that I'm using for testing. I'm okay building a VM dedicated solely to seL4 development if that's necessary, but I'm assuming it's not.
FYI I had some difficulty with the prerequisites instructions regarding Debian. This may be the source of the problem I'm having but I'm not sure how to resolve it. Your setup instructions said to refer to the docker requirements but when I went there I couldn't find anything on that page that indicated what exactly I was supposed to install.
All that being said, here is a capture from my terminal which I'm hoping illustrates the problem I'm having specifically:
rmitchell@ou812:~/sel4-tutorials-manifest$ ./init --tut hello-world Traceback (most recent call last): File "./init", line 16, in <module> import common File "/home/rmitchell/sel4-tutorials-manifest/projects/sel4-tutorials/common.py", line 16, in <module> import sh ModuleNotFoundError: No module named 'sh' rmitchell@ou812:~/sel4-tutorials-manifest$ python Python 3.9.1 (default, Mar 19 2021, 01:08:36) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
import sh sh.__version__ '1.14.1' exit()
As you can see from my example above, I have Python 3.9.1 installed and it is the default python interpreter on my system. The "sh" module is installed and accessible from Python's interactive interpreter, yet when the common.py file tries to import it, it complains that it can't find the 'sh' module. FYI sh is installed both at the system and user levels.
I'll try digging into your source and see if I can figure out what the issue is. I'll share my findings if I figure it out before you guys point out my mistakes.
Thanks! Royce Mitchell, IT Consultant ITAS Solutions royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and off-by-one errors.
Royce,
it would be nice if there was a way to switch the sel4 tutorials to use "python" instead of "python3" so that I could use the latest python without causing upset in the operating system, however I'm just going to roll back my default python3 command and use the builtin version to get this running, since I assume I don't need the latest python to run your tutorials.
Actually, there is a solutiuon for for, it's called "docker". There are docker container for seL4 development that contain all the tools. Have you considered using them? And to do some advertising for my employer: This is also what the TRENTOS-M SDK for seL4 from HHENSODLT Cyber will cover. It comes with with everything running in docker environments (and the setup instructions). So things work out of the box and there's no need to mess up you host environment. Axel
Thanks, but my experiences with containers so far have been ... unpleasant.
Also, I'm already in a VM, so if I'm going to need to go that direction,
I'd just as soon spin up a different VM. Less complicated that way.
Royce Mitchell, IT Consultant
ITAS Solutions
royce3@itas-solutions.com
There are three hard problems in computer science: naming things, and
off-by-one errors.
On Thu, Apr 8, 2021 at 1:27 AM Axel Heider
Royce,
it would be nice if there was a way to switch the sel4 tutorials to use "python" instead of "python3" so that I could use the latest python without causing upset in the operating system, however I'm just going to roll back my default python3 command and use the builtin version to get this running, since I assume I don't need the latest python to run your tutorials.
Actually, there is a solutiuon for for, it's called "docker". There are docker container for seL4 development that contain all the tools. Have you considered using them?
And to do some advertising for my employer: This is also what the TRENTOS-M SDK for seL4 from HHENSODLT Cyber will cover. It comes with with everything running in docker environments (and the setup instructions). So things work out of the box and there's no need to mess up you host environment.
Axel
This is not great practice but I think it "should" work for your use case. As a user you could do something like:
```
mkdir -p $HOME/bin
ln -s $(which python3.9) $HOME/bin/python3
```
This will create a fake "python3" binary that's symlinked to python3.9. Then before you run anything SEL4 related, you can run `export PATH=$HOME/bin/:$PATH` which will trick your shell into using python3.9 for its python3 needs, since it's at the front of your path. This won't interfere with your global python configuration and lead to problems with apt and lsb_release (just make sure to reset your path or restart your terminal before using those tools).
--Justin
On 4/8/21, 2:15 AM, "Royce Mitchell III"
participants (3)
-
Axel Heider
-
Restivo, Justin P.
-
Royce Mitchell III