top 50 comments

sorted by: hot top controversial new old
[–] 59 points 3 years ago* (4 children)

Download ML thing.
make new venv.
pip install -r requirements.txt.
pip can't find the right versions.
pip install --update pip.
pip still can't find the right versions.
install conda.
conda breaks for some reason.
fix conda.
install with conda.
pytorch won't compile with CUDA support.
install 2,000,000GB of nvidia crap from conda.
pytorch still won't compile.
install older version of gcc with conda.
pytorch still won't compile.
reinstall the entire operating system with debian 11.
apt can't find shitlib-1.
install shitlib-2.
it's not compatible with shitlib-1.
compile it from source.
automake breaks.
install debian 10.
It actually works.
"Join our discord to get the model".
give up.

  • source
  • hideshow 8 child comments
  • [–] 1 point 3 years ago

    I recommend distrobox for adhoc distrohopping. Though for Nvidia stuff it links to drivers and cuda that you have installed on your host, so... I recently needed cuda 11.8 and that was hella fun to get going.

  • source
  • parent
  • [–] 28 points 3 years ago (5 children)
    load more comments (5 replies)
    [–] 24 points 3 years ago

    It's like my own little Fediverse

  • source
  • [–] 20 points 3 years ago

    Feels very validating to see that everyone else's Python is held together by a thread too.

  • source
  • [–] 15 points 3 years ago (2 children)
    load more comments (2 replies)
    [–] 14 points 3 years ago (3 children)

    Thank god for NixOS. (My daily on my laptop, seriously flakes + nix-direnv is godsend for productivity. Reliable development environments and I don’t have to lift a finger!)

  • source
  • hideshow 6 child comments
  • [–] 14 points 3 years ago* (last edited 3 years ago) (8 children)

    My workflow:

    cd project
    python -m venv .venv
    . ./.venv/bin/activate
    pip install -e .
    

    By default pyvenv excludes system packages, so I can have different versions in the venv. To reset the venv, I just have to delete the .venv dir.

  • source
  • hideshow 9 child comments
  • [–] 1 point 3 years ago (1 child)

    Seconded, after being burned repeatedly I always do this. But why are you calling activate from the directory above?

  • source
  • parent
  • hideshow 2 child comments
  • load more comments (7 replies)
    [–] 13 points 3 years ago* (3 children)

    I've recently discovered pipenv, and it has been a massive QoL improvement. No need to figure out bazillion of commands just to create or start an environment, or deal with what params should you use for it like you do with venv. You just pipenv install -r requirements.txt, and everything is handled for you. And when you need to run it, just pipenv run python script.py and you are good to go.

    The best thing however are the .pipfiles, that can be distributed instead of requirements.txt, and I don't get why it's not more common. It's basically requirements, but directly for pipenv, so you don't need to install anything and just pipenv run from the same folder.

  • source
  • hideshow 5 child comments
  • Yessssss

    I actually wrote a script to make a folder an instant pipenv environment for me. Add it to your ./.zshrc. Has saved me a ton of time, I just removed some spaghetti lines that would reinstall pip and shit because it's when I was still early days into Py dev, now I work more with Py than I do C# and I'm a senior C# engineer, I just enjoy the masochism of py.

    Also added a check for Arch/Ubu.

    # Automated python virtual environment.
    #######################################
    VENV(){
    if ! [ -x "$(command -v pipenv)" ]; then
         echo "pipenv not installed... installing it now!"
         sudo pip install pipenv
         OS="$( ( lsb_release -ds || cat /etc/*release || uname -om ) 2>/dev/null | head -n1 )"
         if [[ "$OS" == *"buntu"* ]]; then
            sudo apt install pipenv -y
         elif  [[ "$OS" == *"rch"* ]];  then
            sudo pacman -S pipenv
         fi
         pip install pipenv --upgrade
         echo "Installation complete!"
    fi
    if [ -n "$1" ]; then
            echo -e "Args detected, specifically using version $1 of python in this project!"
            version="$1"
    else
            version=$(python -V)
            version=$(echo "$version" | sed -e 's/Python //')
            if [ -z "$version" ]; then
                    version=$(python3 -V)
                    if [ -z "$version" ]; then
                             echo "No python version installed... exiting."
                             return
                    fi
            fi
    fi
    echo -e "\n===========\nCreate a Python $version virtual environment in $PWD/.venv [y/n]?\n==========="
    read -r answer
    case $answer in
        [yY][eE][sS]|[yY])
    export PIPENV_VENV_IN_PROJECT=1
    pipenv --python "$version"
    pipenv install -r ./requirements.txt
    echo -e "\n\n\nVirtual python environment successfully created @ $PWD/.venv!\n"
    echo -e "To run commands from this dir use 'pipenv run python ./main.py'"
    echo -e "To enter a shell in this venv use 'pipenv shell'."
    echo -e "To install from a requirements text file use 'pipenv install -r requirements.txt'"
    echo -e "To update pip + all pip modules use 'pipenv update'!\n"
    echo -e "Additional information can be found @ https://pipenv-fork.readthedocs.io/en/latest/basics.html"
    ;;
        [nN][oO]|[nN])
            echo "Fine then weirdo why did you run the command then, jeez.Exiting"
    ;;
     *)
     echo "Invalid input..."
     ;;
     esac
    }
    
  • source
  • parent
  • [–] 1 point 3 years ago (1 child)

    I could redraw this whole chart using only references to pipenv based on my experiences with managing it alongside other tools (especially homebrew). It’s good at many things but is no magic bullet.

  • source
  • parent
  • hideshow 2 child comments
  • load more comments (1 reply)
    [–] 9 points 3 years ago

    Now take all of this and find something that needs an old out of date Python... Like 2.6.

    .. cry later

  • source
  • [–] [S] 8 points 3 years ago
    [–] 7 points 3 years ago

    Oh, so that is where all of my modules are? That makes total sense, thanks!

  • source
  • [–] 7 points 3 years ago

    Throw pyenv in there and add some more complexity!

  • source
  • [–] 6 points 3 years ago

    Hopefully Mojo will sort it all out. Maybe even inspiring a new, positive streak of xkcd strips in the future?

  • source
  • [–] 5 points 3 years ago (3 children)

    Honestly, at this point I'm running all my python environments in different docker containers. Much easier to maintain.

  • source
  • hideshow 6 child comments
  • [–] 5 points 3 years ago (3 children)

    Wait, you guys don't have a vm for each project and just use ssh to work on them?

  • source
  • parent
  • hideshow 5 child comments
  • [–] 1 point 3 years ago (2 children)

    How does the workflow works in practice? You just use the containers to compile your code, or do you actually have a whole dev environment with IDE and everything and work directly in the container? I can't imagine how does the workflow looks. Or is it possible to set up i.e. a JetBrains Rider to always spin up a container to compile the code in it? But then, if all the requirements and libraries are only on the container, how would it be able to do syntax highlithing and Intelisense (or what's the correct work for code completion), if it doesn't have the libraries on the host?

    I'm probably missing something, but all the solutions I can figure out with my limited experience have issues - working on IDE in a VM sounds like a nightmare with moving files between VM and host, and the whole "spin up a VM, which takes time and it usually runs slower on the shitty company laptop, just to make a quick edit in one project". And I feel like setting up an IDE to use environment that's in a VM, but the IDE runs on a host sounds like a lot of work with linking and mounting folders. But maybe the IDEs do support it and it's actually easy and automated? If that's the case, then I'll definitely check it out!

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 3 years ago (2 children)

    Check out dev container in VSCode. Even better with Codespaces from Github. You can define the entire environment in code, including extensions, settings, and startup scripts along with a Docker container. Then it's just one button click and 5 min wait until it's built and running. Once you have built it you can start it up and suspend it in seconds, toss it out when you don't need it, or spin up multiple at once and work on multiple branches simultaneously.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 3 years ago

    Hmm, I wonder if this would be applicable for game development, which is my main field of work. But I do some projects here and there that don't require an actual engine, so I'll definitely check it out! It does sound pretty easy to set up. Thank you.

  • source
  • parent
  • [–] 1 point 3 years ago

    Part of that was a joke, but i do sometimes use a windows vm when i am working with a windows build, só i just have the vm openned on my second monitor and emacs open on my main machine, than i ssh within emacs into the vm and build and debug the code there, this way i don't need a whole dev enviroment, just git and the build tools

  • source
  • parent
  • load more comments (1 reply)
  • [–] 5 points 3 years ago*

    Poetry is nice for this but honestly, Rust's cargo and the JS npm/yarn have spoilt me.

  • source
  • [–] 5 points 3 years ago

    This is now the process to configure your environment for learning Python through Minecraft Java.

  • source
  • [–] 4 points 3 years ago

    As a mac user I feel this

  • source
  • [–] 2 points 3 years ago

    This Helen’s on my laptop from following AI install scripts. I high key hate Python, it’s my hated language and I wish another language was the default for ML.

  • source
  • load more comments
    view more: next ›