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" wrote:
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 wrote:
> 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.
>>>
>>
_______________________________________________
Devel mailing list -- devel@sel4.systems
To unsubscribe send an email to devel-leave@sel4.systems
________________________________
Notice: This email and any attachments may contain proprietary (Draper non-public) and/or export-controlled information of Draper. If you are not the intended recipient of this email, please immediately notify the sender by replying to this email and immediately destroy all copies of this email.
________________________________