A crucial question on coexistence of Py2-Py3 under Ubuntu distro - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: A crucial question on coexistence of Py2-Py3 under Ubuntu distro (/thread-16618.html) |
A crucial question on coexistence of Py2-Py3 under Ubuntu distro - samsonite - Mar-07-2019 Since a couple of hours ago, I believed that (pip) installer was saved somewhere and kept when libraries were called by Python2 or Python3. Opening my OS Ubuntu 16.04.6 LTS and being checked through pip freeze that this lib sympy==1.3 was working, I tested such a code# ------- ind_int.py --------- from sympy import * x = symbols('x') a = Integral(cos(x)*exp(x), x) print (Eq(a, a.doit()))Versions installed are as follows: 1st test, successfully done, Python2 works properly alfabeta@ubuntu:~/Scrivania$ python ind_int.py Eq(Integral(exp(x)*cos(x), x), exp(x)*sin(x)/2 + exp(x)*cos(x)/2)2nd test, fails, Python3 doesn't read sympy lib alfabeta@ubuntu:~/Scrivania$ python3 ind_int.py Traceback (most recent call last): File "ind_int.py", line 2, in <module> from sympy import * ImportError: No module named 'sympy'Any idea on how overcome the drawback? Thx in advance RE: A crucial question on coexistence of Py2-Py3 under Ubuntu distro - buran - Mar-07-2019 1. check that you have pip3 installed $ pip3 -v 2. if present use: $ pip3 install sympy or $ python3 -m pip install sympy 3. if not present - install it Also, it's better to start using virtual environments, instead of installing packages in the system python installation RE: A crucial question on coexistence of Py2-Py3 under Ubuntu distro - samsonite - Mar-07-2019 So fine, buran! As shown here http://imgbox.com/1ZSzYppf You wrote: Quote:Also, it's better to start using virtual environments, instead of installing packages in the system python installationMy Ubuntu distro is installed in a Virtual Machine, hosted by Windows-10 as per att'd screenshot http://imgbox.com/x8FwcK7o Do you mean that? What a wonderful forum! Thank you very much RE: A crucial question on coexistence of Py2-Py3 under Ubuntu distro - buran - Mar-07-2019 (Mar-07-2019, 11:09 AM)samsonite Wrote: Do you mean that?No, I mean python virtual environments RE: A crucial question on coexistence of Py2-Py3 under Ubuntu distro - samsonite - Mar-07-2019 Right, buran! Nevertheless the matter doesn't concern operating systems which are updated periodically via distribution repository. Namely, sudo apt-get update && apt-get upgrade . In such circumstances both my Py2-Py3's get the versions uploaded in Ubuntu repos. And that's enough for me. Cheers RE: A crucial question on coexistence of Py2-Py3 under Ubuntu distro - snippsat - Mar-07-2019 (Mar-07-2019, 01:05 PM)samsonite Wrote: sudo apt-get update && apt-get upgrade. In such circumstances both my Py2-Py3's get the versions uploaded in Ubuntu repos.That will not update to eg Python 3.7.2,that why i always use pyenv Simple Python Version Management. RE: A crucial question on coexistence of Py2-Py3 under Ubuntu distro - buran - Mar-07-2019 (Mar-07-2019, 01:05 PM)samsonite Wrote: Right, buran! It's not about updating the system, though as snippsat said - it will not update you to newer versions. It is about isolating your projects and dependencies RE: A crucial question on coexistence of Py2-Py3 under Ubuntu distro - samsonite - Mar-07-2019 when I wrote And that's enough for me implicitly I intended that the matter is ouside my main goal: the coexistence of Py2-Py3 in Ubuntu OS, properly solved following the drifts of this thread.Cheers, and best wishes to both. |