Python and Web Programming set up

System Details Report


Report details

  • Date generated: 2024-04-08 22:03:14

Hardware Information:

  • Hardware Model: ASUSTeK COMPUTER INC. Vivobook_ASUSLaptop X1605EA_X1605EA
  • Memory: 8.0 GiB
  • Processor: 11th Gen Intel® Core™ i5-1135G7 × 8
  • Graphics: Intel® Xe Graphics (TGL GT2)
  • Disk Capacity: (null)

Software Information:

  • Firmware Version: X1605EA.203
  • OS Name: Fedora Linux 39.20240406.0 (Silverblue)
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 45.5
  • Windowing System: Wayland
  • Kernel Version: Linux 6.8.4-200.fc39.x86_64

Good evening!
I want to learn python and web programming but I can’t use silverblue very well. It seems that there are many restrictions. I’ve install code OSS and Vs codium but the functionalities were limited. Kivy doesn’t function well especially if I’m using .kv language and tkinter doesn’t work at all. I can’t use node.js in web programming using my device. Now I wonder what have gone wrong and why.

Thanks.

Hello @edgarv7 ,
Welcome to :fedora: !

The two are not really related. Programming and web development can be done very well on Silverblue.

It’s a paradigm shift issue, not a limitation of technology.
For the Fedora Atomic versions like Silverblue, you may/will likely find that container based workflows reign supreme. There are people using the Fedora Atomic variants to do what you are trying, I’m sure they’ll likely respond with their usage/setup. There are also copious discussion around here regarding using VsCode.

2 Likes

Hi! I am also a silverblue user doing development, let me try to explain the different options you have and what I am personally using. Development on silverblue is different than what most linux users are doing (installing things on the host) so it can be somewhat difficult to find information. It works great once everything is setup though.

flatpak
So from your post I get that you tried installed your IDE (vscode) using flatpak. After installing the IDE you need to install python and node inside the flatpak or integrate the IDE with toolbox (see bottom of this post). It is not possible to use the installation on the host: flatpak is a sandbox. This is also the advantage of flatpak because you can keep your host system clean of development files if you configure the sandbox correctly.

To make node and python available inside the flatpak there are 2 options: install flatpak extensions or use mise. Flatpak extensions are the simpelest option when available. Open a terminal and search for your node version. Then install the found extension. Note that the extension should be targeting the branch of the installed freedesktop SDK version that your IDE uses. Currently that is 23.08 for most IDE’s.

$ flatpak search node | grep 23.08
Node.js 20.x	JavaScript runtime built on V8 JavaScript engine	org.freedesktop.Sdk.Extension.node20	20.12.1	23.08	flathub
Node.js 18.x	JavaScript runtime built on V8 JavaScript engine	org.freedesktop.Sdk.Extension.node18	18.18.1	23.08	flathub

$ flatpak install org.freedesktop.Sdk.Extension.node18
...

After executing the above commands tell your IDE to use the extensions: flatpak override --user --env=FLATPAK_ENABLE_SDK_EXT=* com.visualstudio.code. This is also explained in visual studio code flatpak readme.

Using mise is another way to install node / python into the flatpak. This is the best option if you want to install python inside the flatpak because there is no flatpak extension. This is what I am using for go, node and java but might be a bit difficult if you are just getting starting with development. See the mise documentation how to get started, then point your IDE to the node / python installation installed by mise.

toolbox
Another option is installing the IDE inside toolbox. This will give a more traditional way of setting up an environment. To create a toolbox do toolbox create and then do toolbox enter to open a shell inside the toolbox. From there use normal dnf commands to install and launch the IDE. See the toolbox documentation for more info. The advantage of this option is that it is possible to completely automate the setup using Dockerfiles.

flatpak with toolbox integration
The option I recommend to you is installing the IDE using flatpak and then using toolbox to install python / node. This is probably the easiest to setup and works great with visual studio code. Might not be a valid option for other IDE’s.

The most important step to getting this working is creating a fake podman/docker binary inside the flatpak container that ‘proxies’ the commands to podman. This can be done by executing the following commands on the host, which will create a ~/.bin directory with an executable ‘proxy’ script called docker. Then it will add this directory to the PATH of the visual studio code flatpak.

$ mkdir ~/.bin
$ cat > ~/.bin/docker << \EOF
#!/bin/sh
flatpak-spawn --host podman "$@"
EOF
$ chmod +x ~/.bin/docker
$ flatpak override --user --env=PATH=/app/bin:/usr/bin:$HOME/.bin com.visualstudio.code

After executing this restart the IDE. Now install the Dev Containers extension published by microsoft and open the Remote Explorer side menu. Assuming that you have created a toolbox and everything is working you should see your toolbox in the Other Containers block. Click on the arrow to attach the container on the toolbox. Then do the things you would normally do, install python and node using dnf, install the extensions etc…

Yes I uploaded the video to a random git repo because it is not possible to upload video’s to this website ;(

conclusion
So I think these are the 3 options you have. The last one is probably the best, but not available for every IDE. If you get stuck setting up your environment I would be more than happy to clarify.

3 Likes

I would say Fedora Workstation would have been a better choice as it appears you are new to Development & Very New to Containerized Workflows. Since you will probably learn from guides and courses, this workflow with Silverblue is not really covered and can be hard to understand or setup Development environments for.

While the Atomic OS is a great way for intermediate and Advanced Developers and Sys/DevOPs, I do not believe a new level 1 Programmer should use it.

3 Likes

I agree that if you are new to programming workstation might be a better option. But it might be worth it to give visual studio code with toolbox integration a quick try though, depending on what you are doing it might all just work without problems after setup. You will have a normal environment similar to workstation inside the toolbox. Just remember to do a toolbox enter or use the visual studio code console when following tutorials. It also has its advantages: if you screw up it is possible to restart by creating a new toolbox.

But if you do run into problems, then it is probably a good idea to switch to workstation. It is difficult to find information online for developing on an Atomic desktop, so probably not the best option when learning to program.

2 Likes

I’d agree with a caveat though the the CI/CD type of dev setup is way more congruous with the Atomic Fedora variants. There are so many container images available for making a local CI/CD setup that are usable with a forge like github through actions, etc…

2 Likes

Thank you guys for helping me!

2 Likes

If you have any other questions, please post them here.

1 Like