a66ey, to python

About half a year ago I wrote myself a little script to automate via .

Tried to use it on my second 💻 today, to no avail and much grinding of teeth.

I'm not setting up any more . I'm fed up. I'm bloody rewriting everything, even libraries in so it works proper on damn it. And maybe throw a look at some porting while at it.

villares, to python Portuguese
@villares@ciberlandia.pt avatar

Será que é hoje que eu vou aprender a usar um "ambiente virtual levinho" feito com o módulo #venv do #Python?

  • docs: https://docs.python.org/3/library/venv.html
  • para criar: python -m venv <path_do_venv>
  • para ativar, no Linux pelo menos: source <path_do_ven>
  • para desativar: deactivate
  • para por nos scripts .py ("shebang"):#! <path_do_env>/bin/python
alatitude77, to python
@alatitude77@mastodon.social avatar
publicvoit, to NixOS
@publicvoit@graz.social avatar

TIL: isn't compatible with my usual process: https://www.reddit.com/r/NixOS/comments/16bpe89/how_to_deal_with_python_venv_and_their_hardcoded/ 😩

All sorts of workarounds that either sound very dirty or require much more complexity such as docker images for simple Python scripts.

I guess I'll stick with a hard-coded Python version for now so that the path won't change. Let's learn how to accomplish that ... 🙄

Edent, to python
@Edent@mastodon.social avatar

Grrr. I have a stupid problem.

I use cron to trigger a script in a - like so:

5 * * * * /path/to/script/bin/python /path/to/script/example.py

That works. But when the script tries to read or write a file, it uses my home directory.

Is that normal? I would have thought it would use the directory the file is in. But it appears to use the home of the user running cron.

Is there a sensible way to fix this?

setebos, to python
@setebos@mastodon.online avatar

You usually want a separate virtual environment for your project. And it is quite annoying to activate it whenever you start your work on it.
Here is an example of how you can the activation of your env with Makefile. This makes it possible to just run make go to start your project in your automagically. You can also add a similar test target to run tests in the env you want by just running make tests.

djpeacher, (edited ) to random
@djpeacher@fosstodon.org avatar

Nice, spent the last two hours #debugging an upstream #dependency issue, only for the issue to be “yanked” upstream. Thankful, but dang does my head hurt!

djpeacher,
@djpeacher@fosstodon.org avatar

#til Poetry creates its own #venv when it gets installed, separate from your installed dependencies 😵‍💫

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • ngwrru68w68
  • everett
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • GTA5RPClips
  • Durango
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • DreamBathrooms
  • provamag3
  • tacticalgear
  • osvaldo12
  • tester
  • cubers
  • cisconetworking
  • mdbf
  • ethstaker
  • modclub
  • Leos
  • anitta
  • normalnudes
  • megavids
  • lostlight
  • All magazines