5 ms·
This reminds me of a Flask mini project I did. I was doing it in Ubuntu (LTS if I'm not mistaken). I picked python3 and ran with it. As I tried to use Python's
by arenaninja 12y ago
This reminds me of a Flask mini project I did. I was doing it in Ubuntu (LTS if I'm not mistaken). I picked python3 and ran with it. As I tried to use Python's virtualenv (venv), I went down the rabbit hole of a broken mess that was left in Ubuntu. I just reinstalled Ubuntu this week so I might give it another shot, but every time I try to do something with Python I end up with a broken mess, and that's disheartening
- teabee89 12y agoYou could use Docker, that way your host Ubuntu is kept clean. docker pull python:2.7 docker pull python:3 For more granular tags: https://registry.hub.docker.com/_/python/ https://registry.hub.docker.com/_/python/
- valarauca1 12y agoI think the problem that is being had is Ubuntu packages. Which Docker in and of itself won't solve. All it will do is isolate packages from the rest of the OS. Which python is fairly generic, and building your own python libraries, and gutting python packages from Ubuntu will have the same affect. Either way you are hand installing a lot of packages.
- pekk 12y agoI'm also sorry that Ubuntu broke venv, but there were many (edit: at least a few that I remember) attempts to file tickets to get that fixed in Ubuntu, lots of stupid arguments against fixing it
- arenaninja 12y agoIt definitely turned me away from Python yet again for the time being. I'm now rewriting that same project in Laravel. I understand that it's not python's fault, but every time I've tried to use it some package is broken, and the alternative is going back to python2
- dschep 12y agoAFAIK -mvenv is still kaput in Ubuntu. I just this instead: sudo apt-get install python-virtualenv python3 virtualenv -p/usr/bin/python3 <venv> Yes, it'd be way cooler if -mvenv wasn't crippled in Ubuntu, but this still works fine.
- arenaninja 12y agoYea I was doing this until I also ran into a horrible mess later on due to the underlying issue that resulted in a catch 22 (something like pip is broken because venv is broken because pip is broken...). Unfortunately I didn't see [this tweet](https://twitter.com/danilobellini/status/461653494295179264 https://twitter.com/danilobellini/status/461653494295179264) at that time, or things might have turned out differently
- mdf 12y agoI know this is a bit of a dirty trick, but so far it has worked without problems for me at least: The issue seems to rise from a missing ensurepip module. I fixed this by just downloading the Python 3.4 sources, unpacking them and copying the unpacked lib/ensurepip/ to /usr/lib/python3.4/ after which python3 -m venv seems to work fine.
- viraptor 12y ago> As I tried to use Python's virtualenv (venv), I went down the rabbit hole of a broken mess that was left in Ubuntu. What do you mean? virtualenv exists exactly so that your libs are installed in your local directory and not globally in the system. I'm not sure how it could result in broken mess in the system that way.
- arenaninja 12y agoThis is the bug I'm talking about: https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1290847 https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/129.... I think the distro was Ubuntu 14.04 LTS, but I do not remember exactly
- mrweasel 12y agoUbuntu, at least some versions, ship with a horribly broken Python3. Broken because pip and virtualenv is somehow screwed up. It's an Ubuntu bug, not Python3. Install Python3 from python.org an everything is fine, except then apt-get of cause won't give you the bug fixes.
- bshimmin 12y agoI'm not doubting your specific experiences, but I set up a Flask project with Python 3 on an Ubuntu system myself about three months ago, and - as someone with a lot of experience with Linux and Ruby (and other things) but relatively little with Python - I didn't have much trouble. It definitely could have been easier, and I think I did have to google a few incantations to make it all work, but it didn't seem terribly hacky or messy to me, and probably no worse than getting the equivalent Ruby/rvm/Sinatra project to work. (Other comments suggest that there are fundamental problems with Python and virtualenv and Ubuntu, so either I just fortuitously missed all of that or maybe I was in such a happy delirium of tinkering that I've now forgotten all about it.)
- ambrop7 12y agoI just use Nix (see [1]), for Python stuff and everything else. I've never tried to use virtualenv and hope I never will. [1] https://nixos.org/wiki/Python https://nixos.org/wiki/Python