Is Pixlet only available on MacOS and Linux?

@AmillionAir I had the same issue. The stuff in the issue I opened and solved should fix it. See the link Here

I’m on mobile so sorry if formatting is off.

You may have to update other libraries too, but this should fix that error.

At this point I’ve done this so many times you’re going to have it memorized by the end ha ha, but having one solid post isn’t a bad idea.

1 Like

WE DID IT EVERYONE!!!

@pineapple I am so thankful you went above and beyond to help a random idiot on the internet figure out how the hell to use Linux.

I guess the last question for any of you guys @pineapple or @jeremy is how do i start using VS Code to make stuff? is there a specific thing i need to point VS code to or is it just as simple as open up one of the example files in VS code and go to town??? Good news is i actually know how to code in python so this is pretty much the last step for me.

1 Like

I’ll type a full reply this weekend - but if you navigate to the directory in WSLwhere you checked out your code and enter “code .” It should launch VSCode with a terminal scoped to your current directory in WSL.

You can then run commands in the built in terminal in VS Code (assuming pixlet is on your path).

@jeremy thanks for volunteering to do a write up for this, I kind of just got mine to work. I kind of just got mine to work after installing those extensions.

To add it to it though in the bottom left corner there should be a tab that may ask you if you want to open remotely if it doesn’t by default. Its also available through one of the tabs in top too.

Still working to keep this guide updates so please let me know if you have suggestions for improving accuracy and understanding. Please see the top of the thread for organized links on how to proceed after installing everything.

  1. Download wsl using the install instructions found here 9

(I then went ahead and also installed the Ubuntu app from the windows store as well, not sure if this is need but I did it. Make sure to properly set up a user account and also map Ubuntu to a drive so you can easily find it later\\wsl$\<distro-name> )

  1. Install VSCode

  2. Navigate to the Tidbyt Github page and copy the link to the pixlet binary file

At the time of posting the most recent version is: pixlet_0.8.5_linux_amd64.tar.gz

  1. Open the Ubuntu terminal run the command sudo curl -O -L (copied Github link address)

  2. After that is finished run the command sudo tar -xf pixlet_0.8.5_linux_amd64.tar.gz

  3. Now in windows navigate to wsl/home/(username) and you’ll now see a file call “Pixlet”

  4. Copy and paste that pixlet file into the location \\wsl$\Ubuntu\usr\bin ).

  5. Run the command sudo chmod +x /usr/bin/pixlet

  6. From here go to github and copy and paste the raw example .star files into your home folder (same folder as step #6)

  7. Now you should be able to run the hello world render and serve test and everything should work!

At the time of posting there is an issues with 0.8.5 being unable to find library libwebpdemux.so.2. To fix this you will need to run and additional step sudo apt-get install -y libwebp-dev

  1. In VS Code download the python and remote developer extension, and also one called Bazel.
    image
    image
    image

Bazel will allow you to open and save .star files. So after everything is installed just open a new tab in VScode and save as a .star!

Alternativly you can launch VS code using Linux with the steps @jeremy outlines as well!

@Scottorama also has steps lined out to run everything in a Virtual Machine as well if thats more your style.

HAPPY HACKING!!

EDIT: After using WSL for a few weeks ive found windows like to mess with permissions and make certain folder off limits when im the only admin account on the PC. Here is a fantastic thread on how to elevate your permissions on any folder you may need and get around this annyoing error.

2 Likes

Couple of clarifications from AmillionAir post above.
This is how to map a network drive from Ubuntu into Windows Explorer:

Step 4 here is an example command:
sudo curl -O -L https://github.com/tidbyt/pixlet/releases/download/v0.9.0/pixlet_0.9.0_linux_arm64.tar.gz

1 Like

Thanks andrew went ahead and added that to the guide!

1 Like

The easiest way of launching VS code is to browse to your directory in WSL, then just type code .. That will launch VS code with your current directory open, then you can just start editing files:

I also use the built in terminal in VS Code to run the various pixlet commands.

2 Likes

Thanks Jeremy!

Added it to the guide as well.

Ok using WSL method I’m stuck as per AmillionAir’s guide on step 9 to render and server for hello world. I’ve also done the “libwebpdemux.so.2” step but I was not experiencing this issue. Plus I’m on v0.9
I keep getting:
“-bash: ./pixlet: cannot execute binary file: Exec format error”
Maybe I’ve written the serve command incorrectly or missing another essential installation.
Any ideas please?

I think i forgot to add this step into my guide initally try running that. You might have also messed something up by running the libwebpdemux.so.2 step if it wasnt needed???

Thanks Amillion!
Yes I ran that sudo chmod +x /usr/bin/pixlet command as per your step 8.
Also I only ran “libwebpdemux.so.2” when I noticed this error, so same result before and after.

PS: My Ubuntu machine is running the pixlet serve with no issues

I had to to a fresh install of windows last night as my WSL permissions got all messed up let me see if i run into the same problem when re installing everything.

@andrewf13 I HAVE THE SOLUTION

sudo apt-get install -y libwebp-dev

run this and it should install all the libraries you need!! i got mine working after that

Thanks already did that, issue persists.
I had a quick look what this error means “cannot execute binary file”, it means the processor type does not match. I had downloaded “arm” version but I’m running an Intel processor so I should’ve downloaded the “amd64” version. Perhaps need a note under step 4 to highlight must download “amd64” version and not “arm”…I don’t think many people would be running arm CPUs on Windows.
My bad, sorry and thanks for your help here!

To run star files located in my home folder, what would be the command please?
Keep getting errors like this:

Note: running files from Github examples folder https://github.com/tidbyt/pixlet/blob/main/examples/hello_world.star works fine, as per my previous post.

If you run pixlet render hello_world.star instead of pixlet serve --watch hello_world.star you may get better diagnostic messages.

I just use:

pixlet serve /home/alex/test.star

Then visit the local host link and if your file has no errors it should work

ah yeh the render command indicts that it “failed to load applet: starlark.ExecFile”
Any ideas please?

The problem is on line 7 of your file, where there’s a < that is unexpected. Can’t really tell more from that screen capture.

1 Like