4 ms·
I really love the idea, but it's sent me down the Python packaging rabbit hole because the very first page's recommendation to use `python3 setup.py develop --u
by macintux 3y ago
I really love the idea, but it's sent me down the Python packaging rabbit hole because the very first page's recommendation to use `python3 setup.py develop --user` doesn't work without some customization that I have yet to figure out.
First, it seems to (maybe?) work better with a venv running, which I didn't have. Ok, I can create one.
Next, `SetuptoolsDeprecationWarning: setup.py install is deprecated`, although I can live with that for now.
Next, I'm provided with a long list of ideas for how to enable `.pth` files, but https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#use-the-user-option https://setuptools.pypa.io/en/latest/deprecated/easy_install... strongly implies that `export PYTHONUSERBASE=`pwd`` prior to running setup should work. It doesn't.
Python, why does your ecosystem have to be so broken?
- alex_lav 3y agoPython packaging sucks. It's a big part of my job right now. To get various things to work, I've had to downgrade setuptools and manually install Cython.
- Too 3y agoThat instruction is not the recommended way. To make it work, use a virtualenv, seriously always use a virtualenv. Then inside: pip install --editable ./ This has been the standard way to install packages since forever. Don’t know why author complicates it with lower level setuptools. This is the same message that deprecationwarning is giving btw.
- macintux 3y agoThanks, that did the trick. I'm going to argue, however, that "standard" is far too strong a word. I've been using Python on a near-daily basis for the last 4 years. I've never run into that, and I don't see it at the Hitchhiker's Guide. Well, that and Python doesn't seem to do standard.
- xcdzvyn 3y agoIt's almost surprising how far Python has come with the state pip is in; it's so rare to have any remotely sizeable software's dependencies install properly without some hacking.
- toyg 3y agoI guess it depends very much on the niche. Datascience? Yeah, hacking probably necessary for all those C/rust stuff. Web? Things will work just fine.
- LeonenTheDK 3y agoI can echo the same. My Python use has largely been automating some tasks at work, nothing incredibly large, but new installation of the deps is always problematic. And the same goes for more than a few OSS projects I try to get working locally.
- deleted 3y ago[deleted]
- PufPufPuf 3y agoPython packaging is dead simple. You just define your package in requirements.txt, setup.py, setup.cfg, MANIFEST.in, pyproject.toml (although this one has two different ways to declare dependencies), and/or Pipfile. You then use pip, pipenv, virtualenv, venv, virtualenvwrapper, pyenv, pyenv-virtualenv, pyenv-virtualenvwrapper, poetry, and/or conda to install and manage the package.
- deleted 3y ago[deleted]