4 ms·
Pip. Generally, reliable python setup is really easy (at least on linux, don't know about other platforms). 1. Don't use the prepackaged system python. You do
by ActorNightly 3y ago
Pip.
Generally, reliable python setup is really easy (at least on linux, don't know about other platforms).
1. Don't use the prepackaged system python. You don't want package installs interfering with stuff your distro needs. Build python from scratch from source after apt-get or pacman installing the necessary dependencies for full functionality, then use make altinstall. It will leave the binaries in the major.minor version format without overwriting the python3 symlink.
2. Use get-pip.py to install pip by invoking it directly with the python version you just built. This will alias pip and pip3 to point to the correct version. Optionally, you can uninstall any package manager installed pip for safety. The pip executables should be in .local/bin
3. Never run pip as sudo, so that it install packages in user home directory (.local/lib)
4. If you need version control, use virtual environments.
- jzombie 3y agoI started a project, not sure if it's a good idea (but it is helpful to me), which helps to make pip/venv a little easier to work with. It's a set of Bash commands that wrap pip, basically. https://github.com/jzombie/pipper https://github.com/jzombie/pipper - Package Installer and Python Project Environment Runner
- roland35 3y agoVirtualenvwrapper is another convenient tool - all you need after setting it up is type "workon x"
- jzombie 3y agoJust checked it out. Yes, that's very similar indeed, and I'll probably draw some inspiration from it. My use case is to primarily help me understand pip/venv a bit better and do more experiments with bash.