this post was submitted on 04 Jan 2025
9 points (90.9% liked)

Steam Deck

15155 readers
1548 users here now

A place to discuss and support all things Steam Deck.

Replacement for r/steamdeck_linux.

As Lemmy doesn't have flairs yet, you can use these prefixes to indicate what type of post you have made, eg:
[Flair] My post title

The following is a list of suggested flairs:
[Discussion] - General discussion.
[Help] - A request for help or support.
[News] - News about the deck.
[PSA] - Sharing important information.
[Game] - News / info about a game on the deck.
[Update] - An update to a previous post.
[Meta] - Discussion about this community.

Some more Steam Deck specific flairs:
[Boot Screen] - Custom boot screens/videos.
[Selling] - If you are selling your deck.

These are not enforced, but they are encouraged.

Rules:

Link to our Matrix Space

founded 3 years ago
MODERATORS
 

I've been trying to code python on my deck and I can't for the life of me figure out how to activate the virtual environment. I keep using "source .venv/bin/activate" and it does nothing. No errors, no feedback, doesn't hang, doesn't use the environment, nothing.

I've tried installing Kitty to see if it was an issue with Konsole but the exact same thing happens. It works fine in Visual Studio Code but I do t want to have to open that every time I try and run a command.

Anyone know why this could be or what I could do to fix it?

Edit to add: This is my first real attempt at Linux idk what I'm doing in a very broad way. Only other time I tried was nearly 15 years ago dual booting Windows/Ubuntu but that lasted like a week because Windows kept blowing up the config and I needed some Windows only programs for school

Solved edit: I don't exactly know what was up. If I made the venv with the terminal, it would work in the terminal but not work with VSCode's terminal. If I made it in VSCode it would work in VSCode's terminal but not the normal terminal. I uninstalled VSCode, made the venv in the Konsole terminal, and everything seems to work fine through PyCharm instead.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 6 days ago (1 children)

I'm using Konsole, seems to be the default terminal for me

[–] [email protected] 1 points 6 days ago* (last edited 6 days ago) (1 children)

Inside konsole, you can use different shells. Some common ones are bash, fish, and zsh. The deck comes with all three of those installed by default.

You can usually tell which one you're using by either looking at the title bar of konsole when you first open it (should say something like ~:bash -- Konsole) or by running the command echo $SHELL

Once you've confirmed you're using bash, run which python (or which python3 if you're using python 3). Outside of the venv you should see the command return /usr/bin/python

After you run your source command, run which python again. You should now see that the python location being run has changed to be inside the venv folder.

[–] MrMcGasion 2 points 6 days ago

With SteamOS being Arch-based you shouldn't ever really need to specify python3. Python 2 has been EOL for 5 years now, and the python command almost always points to python3 (unless you deliberately change it).