Skip Navigation
Using source command for virtual Python environment [solved]
  • Okay so I wiped the .venv that VSCode made again and this time ran the venv creation using python3 -m venv venv. It's working with command line now but not within VSCode (running into the same issue that I had before but in reverse, so VSCode isn't recognizing pip or other installed modules like markdown that I added in command line).

    This is starting to feel like maybe a difference in how VSCode handles the virtual environment vs the command line. When I create the venv in one it breaks the other

    Edit: Yeah idk what VSCode is up to. I uninstalled, remade the venv with Konsole, and installed PyCharm instead. Commands through Konsole and the PyCharm terminal are all working as expected now.

    Thank you for the help!

  • Using source command for virtual Python environment [solved]
  • Thank you for help with what commands to run to get more info. I've tried multiple virtual environments each of ones built on the command line and through VSCode and had the same results with each. The current one that I did the cat command on was built with VSCode.

    cat .venv/bin/activate

    This file must be used with "source bin/activate" from bash

    You cannot run it directly

    deactivate () { # reset old environment variables if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then PATH="${_OLD_VIRTUAL_PATH:-}" export PATH unset _OLD_VIRTUAL_PATH fi if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" export PYTHONHOME unset _OLD_VIRTUAL_PYTHONHOME fi

    # Call hash to forget past locations. Without forgetting
    # past locations the $PATH changes we made may not be respected.
    # See "man bash" for more details. hash is usually a builtin of your shell
    hash -r 2> /dev/null
    
    if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
        PS1="${_OLD_VIRTUAL_PS1:-}"
        export PS1
        unset _OLD_VIRTUAL_PS1
    fi
    
    unset VIRTUAL_ENV
    unset VIRTUAL_ENV_PROMPT
    if [ ! "${1:-}" = "nondestructive" ] ; then
    # Self destruct!
        unset -f deactivate
    fi
    

    }

    unset irrelevant variables

    deactivate nondestructive

    on Windows, a path can contain colons and backslashes and has to be converted:

    if [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then # transform D:\path\to\venv to /d/path/to/venv on MSYS # and to /cygdrive/d/path/to/venv on Cygwin export VIRTUAL_ENV=$(cygpath /home/deck/Repos/PysidianSiteMaker/PysidianSiteMaker/.venv) else # use the path as-is export VIRTUAL_ENV=/home/deck/Repos/PysidianSiteMaker/PysidianSiteMaker/.venv fi

    _OLD_VIRTUAL_PATH="$PATH" PATH="$VIRTUAL_ENV/"bin":$PATH" export PATH

    unset PYTHONHOME if set

    this will fail if PYTHONHOME is set to the empty string (which is bad anyway)

    could use if (set -u; : $PYTHONHOME) ; in bash

    if [ -n "${PYTHONHOME:-}" ] ; then _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" unset PYTHONHOME fi

    if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then _OLD_VIRTUAL_PS1="${PS1:-}" PS1='(.venv) '"${PS1:-}" export PS1 VIRTUAL_ENV_PROMPT='(.venv) ' export VIRTUAL_ENV_PROMPT fi

    Call hash to forget past commands. Without forgetting

    past commands the $PATH changes we made may not be respected

    hash -r 2> /dev/null

    which python

    /usr/bin/python

    python -m pip freeze (before source)

    aiohttp==3.9.1 aiosignal==1.3.1 anyio==4.2.0 attrs==23.2.0 btrfsutil==6.7.1 certifi==2024.2.2 cffi==1.16.0 click==8.1.7 crcmod==1.7 crit==3.18 cryptography==41.0.7 dbus-next==0.2.3 dbus-python==1.3.2 distro==1.9.0 evdev==1.6.1 frozenlist==1.4.1 h11==0.14.0 hid==1.0.4 httpcore==1.0.2 httpx==0.26.0 idna==3.6 iotop==0.6 multidict==6.0.4 nftables==0.1 packaging==23.2 perf==0.1 ply==3.11 progressbar2==4.3.2 protobuf==4.25.2 psutil==5.9.8 pyalsa==1.2.7 pyaml==23.9.0 pycparser==2.21 pyelftools==0.30 pyenchant==3.2.2 PyGObject==3.46.0 python-utils==3.8.2 PyYAML==6.0.1 semantic-version==2.10.0 smbus==1.1 sniffio==1.3.0 SteamOS Atomic Updater==0.20190711.0 steamos_log_submitter @ file:///builds/holo/holo/holo/steamos-log-submitter/src/steamos-log-submitter typing_extensions==4.9.0 yarl==1.9.4

    python -m pip freeze (after source)
    No module named pip

  • Using source command for virtual Python environment [solved]

    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.

    11
    Man Returns To Work After Vacation With Fresh, Reenergized Hatred For Job
  • Keeping in mind I've only visited 1-2 towns from each place

    • Sweden, Stockholm and Visby: The language is gorgeous sounding I like listening to people talk. I like how everyone walks in the street. People are very nice. I had a sense of belonging like I had already been living there so that's a good sign for moving.
    • Estonia, Tallinn: Holy shit I got to walk on a real castle wall. There's a meshing of modern and medieval architecture that works stunningly it's so amazing. Rich history everywhere.
    • Latvia, Riga: Grafitti game is on point. The art nouveau is incredible but I preferred the castles tbh. There is a very palpable tension between Latvian and Russian that put me on edge. Like if I said thank you in Latvian some people would get upset at me, but if I said thank you in Russian other people would correct me "this is LATVIA". I bring this up as a favorite because it reminds me that visiting for a few days doesn't mean I understand the area.
    • Netherlands, Amsterdam and The Hague: To get off the plane and out of Amsterdam skipping it entirely was super easy. New Years in The Hague was unreal like nothing I've ever seen. Indonesian food is very good here too. Everyone here bikes, transit flows well, the trolleys are fun to watch. I question how many people fall into the river that has almost no guardrails anywhere.
    • Sweden again, soon I'm flying north to play in the snow and work my way back to Stockholm. No reports yet but I love cold and snow so I suspect I'll be happy there too.

    I'm going to try and swing getting there on a student visa. I need to save enough to pay for housing and tuition, I'm guessing about $30k should get me there if I also find a part time job while at school. My Swedish is incredibly basic so far but I'm getting decent at reading. A lot of it is close enough to English I can kinda get the gist of text within known contexts. Listening to it though is still well beyond me, it sounds like actual elvish it's wild to me. I want to learn it so much though I want to be able to speak such a pretty language

  • Man Returns To Work After Vacation With Fresh, Reenergized Hatred For Job
  • Yeah this is me in about 10 days. Almost a month vacation to explore Sweden and the Baltic states. Going to get back to work and have like 5 months before I attempt to move to Sweden. I'm dreading being back at work for that time I really hope I can pull through and save up enough for the move while being burnt out

  • See you all next year
  • I'm in my thirties and just had the time of my life. I'm visiting The Hague and got to spend my night dodging mortars and watching actual explosions. 10/10 want to come here next year now too, probably with impact goggles though

  • What do you need to get off your chest before the New Year?
  • 2025 is going to be very difficult for me but it's hopefully transitory into better stuff. My entire social circle collapsed this year so I'm taking the opportunity to move to Sweden and hopefully go back to school. Don't have to worry so much about leaving my friends and loved ones behind if I don't have very many left lol

  • What do you need to get off your chest before the New Year?
  • I think I've talked with my sibling twice in the last three years. They've gone off the deep end with right wing stuff and I just don't have the capacity for it. It's difficult to cut ties but sometimes it's the way to go

  • What do you need to get off your chest before the New Year?
  • My roommate and I used to date and I'm still in love with them. We're making it work well but everything is messy

    I went through a lot of therapy to get past my fear of telling people I love them and getting broken up with shortly after, the day I was going to tell my now roommate I love them they broke up with me out of nowhere. We didn't even date that long and the breakup was nearly a year ago and it still hurts. I don't have many regrets in life but not telling them sooner is one of them

    I had lower surgery shortly after they broke up with me. I was so excited to have someone there for me emotionally and physically after surgery. Now I have nobody and I'm scared to have sex. I don't know how to work past this and therapy hasn't been helping

    I just want to be able to connect with someone without the crushing weight of trust issues around every corner. I miss being with my roommate so much, one of the happiest and most exciting relationships I've ever had

  • Anon visits America
  • What era or genre are you getting the pop culture from? Twinkies at least have only been a joke in media for at least 15 years because of zombie survival stuff, and longer as a 'haha look at the fat kid' before that. Die Hard uses them as a comedic element to break up parts of the film but in less of a joking about Twinkies directly way, though it is part of the overweight cop's character. That movie is nearly 40 years old though and probably marks around the time Twinkies started shifting from a snack to a meme

    Edit to add: They also originally had banana flavored filling. You can still find these sometimes and while not good they're better than the plain ones imo

  • InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)AR
    Ms. ArmoredThirteen @lemmy.zip
    Posts 1
    Comments 43