troet.cafe ist Teil eines dezentralisierten sozialen Netzwerks, angetrieben von Mastodon.
Hallo im troet.cafe! Dies ist die derzeit größte deutschsprachige Mastodon Instanz zum tröten, neue Leute kennenlernen, sich auszutauschen und Spaß zu haben.

Verwaltet von:

Serverstatistik:

7,2 Tsd.
aktive Profile

Mehr erfahren

#virtualenv

0 Beiträge0 Beteiligte0 Beiträge heute

So, I'm tinkering a bit with #Django, and I wanted to run different Django versions on the /same/ virtual machine. Here `#virtualenv` helps only insomuch that it can seperate dev envs, but it all still shares the `~/.local/lib/python3.10/site-packages` folder.

(I can't imagine this problem hasn't been solved, but couldn't find anything online.)

I've resorted to overriding HOME: basically I wrote a `virtualenvenv` script that I source, and then I have the separation I want/need. 🔨

Antwortete Mika

My final boss in solving this #Django on #Alpine container thing is getting #Apache/#WSGI (mod_wsgi) working. My container runs Apache fine, I suppose, if I don't supply it any site config - but once I do (i.e. in /etc/apache2/conf.d), I'm getting Segmentation fault core dumped errors and reboots.

I'm assuming, as far as my config goes, I need to point
python-home to where my #virtualenv is, in addition to python-path to where my Django site/app is (like I do on #Ubuntu since that does not enforce the use of venv yet). But that doesn't seem to be enough, so again, in addition to apache2, apache2-mod-wsgi, and apache2-utils (and perhaps musl-dev and gcc in runtime other than just during build), what am I missing?

Hey #Fedi, can you help me with a #Python environment pain-point?

TL;DR : I want global #virtualenv management

I've been using virtual environments for quite some time, but I might be missing some standard feature because switching env is a pain: I have to be in the right folder (where the venv dir was created) or manually configure a shell script.
Is there a tool that can provide me with the equivalent of ``envswitch envname`` regardless of the folder I'm in?

#venv#poetry#pipenv

After programming a good 2 months in #python finally found the tool #poetry which is quite similar to how #nodejs bundles libraries into a directory either locally or globally in the cache directory.

I have tried the other tools from #pyenv to #venv and/or #virtualenv. Where I thought they were used to deal with library dependency management only to realize that they are more like #nvm.

I did use #conda for some time, though preferred a python only solution. I do realize that poetry won't resolve all issues and might need to look into to containerization later on, though for the time period it looks like a good solution.

@forse

Can you try installing it with `pipx` instead?

pipx will create a Python virtualenv just for that program, and install all of its dependencies into that virtual environment. It can then run independently of any system-level versions of those same packages that are installed *for the distro-shipped Python tools*.

The version pipx installs can be upgraded (or left alone) completely independently of OS updates.