4 ms·
If this is an issue for you, I would highly recommend that you have a look at virtual environments via tools like virtualenv and conda. That way you'll be able
by lunchladydoris 9y ago
If this is an issue for you, I would highly recommend that you have a look at virtual environments via tools like virtualenv and conda. That way you'll be able to run all the versions you like.
- SwellJoe 9y agoI've found that if I set my default Python version to a Python 3 virtual environment, it breaks some system tools on my Fedora system (probably just because my virtual env doesn't have the necessary libraries installed, though I haven't tried to install them to test). Specifically gnome-tweak-tools, but probably others that are built with Python. Sort of a funny quirk. That's not me saying "don't use virtual environments", just be aware you'll probably need to switch back for some system tools.
- jnwatson 9y agoThis is strong evidence that something is set up wrong in your system. pyenv doesn’t change /usr/bin/python. If an app is using your PATH to find python it is going to break.
- SwellJoe 9y agoThe apps in question use a shebang of `#!/usr/bin/env python3`. I believe it is working as designed. This is a Fedora system, which switched to Python 3 a couple of revisions back. But, I would assume this would affect any system that has utilities that use that shebang. Edit: Out of curiosity, I grepped for other system utilities that might have this quirk, and it seems like nearly all Python utilities call /usr/bin/python3 directly, but ten of them (on my system) use `env`. That might be a bug worth filing with the Fedora folks. I can't imagine they want it to act this way when a custom Python is installed. Though it's been that way for at least a couple of releases.
- oblio 9y agoI tried this a while ago. I think Conda allows installing different versions of Python (good) but it doesn't play well with Pip (bad)? Last I tried it also bundled dependencies in its own particular way (ugly)? I think it was more geared towards SciPy and NumPy and other scientific development than towards general purpose programming.
- afarrell 9y ago> I think Conda allows installing different versions of Python (good) Yep. Also allows installing different versions of node or ruby. > Doesn't play well with Pip (bad) You can `pip install` things into a conda environment but I forget how it works with globally pip-installed packages. I don't think it plays nicely with virtualenv. > Last I tried it also bundled dependencies in its own particular way (ugly)? I think it was more geared towards SciPy and NumPy and other scientific development than towards general purpose programming. Yep, it was made by the maintainers of SciPy and NumPy to solve the problem where you have a python package that depends on a system library written in c/fortran/IDL. For an example in ruby, see the problems people have with charlock_holmes: https://stackoverflow.com/search?q=charlock_holmes https://stackoverflow.com/search?q=charlock_holmes
- physicsguy 9y agoYou can install things with pip but you have to be really careful, because Conda tries to do clever things to avoid downloading multiple copies, which is what you end up with in Virtualenvs. So, if you have two environments both using the same version Jupyter version, installed with 'conda install jupyter' it will only have one copy which is symlinked into the environments. Problem is, if you do 'pip install' in one of the environments, it will upgrade the existing version, but overwrite the conda installed one, which will break your other environment. Often though the official conda packages are lagging behind those on pip, so you have to do this anyway, or use Conda Forge which gets more regular updates or use pip (but carefully uninstalling all the conda installed stuff in the environment first) if you want the bleeding edge.
- 9y ago
- icebraining 9y agoAlso, if you want to install Python tools (as opposed to working on code), take a look at pipsi, which simplifies the whole process.