How can I adjust pip3 using python3.6 not python3.4 on Ubuntu 14.04?












4















Default python3 on Ubuntu 14.04 is of 3.4.3 but I want to use 3.6.3 instead.



I followed commands below to install 3.6.3:



$ sudo apt-get update
$ sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
$ sudo apt-get install python3-pip python3-dev

$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt-get update
$ sudo apt-get install python3.6


3.6.3 was then available on my Ubuntu:



$ which python3.6
/usr/bin/python3.6


For sure, python3 was still pointing to 3.4.3:



$ ls -la /usr/bin/python3
/usr/bin/python3 -> /usr/bin/python3.4


pip3 was available but it used 3.4.3 instead of 3.6.3 (what I wanted):



$ pip3 --version
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)


I thought updating /usr/bin/python3 would solve the issue so I did adjusting the python3 symbolic link making it point to 3.6.3:



$ sudo unlink /usr/bin/python3
$ sudo ln -s /usr/bin/python3.6 /usr/bin/python3
$ ls -la /usr/bin/python3
/usr/bin/python3 -> /usr/bin/python3.6


But pip3 didn't work anymore :(



$ pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'


UPDATED



I tried with some suggestions:



$ sudo python3.6 -m pip


and



$ curl https://bootstrap.pypa.io/get-pip.py | sudo -H python3.6


But it showed very similar output:



Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 59, in <module>
from pip.log import logger
File "/usr/lib/python3/dist-packages/pip/log.py", line 9, in <module>
import colorama, pkg_resources
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg


How can I solve the issue?










share|improve this question

























  • Use pip3.6, or use python3.6 -m pip.

    – Martijn Pieters
    Nov 21 '18 at 8:22











  • and doesn't Debian / Ubuntu have an alternatives system to switch shared commands?

    – Martijn Pieters
    Nov 21 '18 at 8:23













  • @MartijnPieters I tried with $ sudo python3.6 -m pip but it showed the same error

    – duong_dajgja
    Nov 21 '18 at 8:24











  • Yeah, you really don't want to mess about with the Ubuntu package management. At the very least, reinstall the python packages.

    – Martijn Pieters
    Nov 21 '18 at 8:27











  • Uninstall pip , delete pip folders and build pip using python3.6

    – Yash Kumar Atri
    Nov 21 '18 at 10:31
















4















Default python3 on Ubuntu 14.04 is of 3.4.3 but I want to use 3.6.3 instead.



I followed commands below to install 3.6.3:



$ sudo apt-get update
$ sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
$ sudo apt-get install python3-pip python3-dev

$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt-get update
$ sudo apt-get install python3.6


3.6.3 was then available on my Ubuntu:



$ which python3.6
/usr/bin/python3.6


For sure, python3 was still pointing to 3.4.3:



$ ls -la /usr/bin/python3
/usr/bin/python3 -> /usr/bin/python3.4


pip3 was available but it used 3.4.3 instead of 3.6.3 (what I wanted):



$ pip3 --version
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)


I thought updating /usr/bin/python3 would solve the issue so I did adjusting the python3 symbolic link making it point to 3.6.3:



$ sudo unlink /usr/bin/python3
$ sudo ln -s /usr/bin/python3.6 /usr/bin/python3
$ ls -la /usr/bin/python3
/usr/bin/python3 -> /usr/bin/python3.6


But pip3 didn't work anymore :(



$ pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'


UPDATED



I tried with some suggestions:



$ sudo python3.6 -m pip


and



$ curl https://bootstrap.pypa.io/get-pip.py | sudo -H python3.6


But it showed very similar output:



Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 59, in <module>
from pip.log import logger
File "/usr/lib/python3/dist-packages/pip/log.py", line 9, in <module>
import colorama, pkg_resources
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg


How can I solve the issue?










share|improve this question

























  • Use pip3.6, or use python3.6 -m pip.

    – Martijn Pieters
    Nov 21 '18 at 8:22











  • and doesn't Debian / Ubuntu have an alternatives system to switch shared commands?

    – Martijn Pieters
    Nov 21 '18 at 8:23













  • @MartijnPieters I tried with $ sudo python3.6 -m pip but it showed the same error

    – duong_dajgja
    Nov 21 '18 at 8:24











  • Yeah, you really don't want to mess about with the Ubuntu package management. At the very least, reinstall the python packages.

    – Martijn Pieters
    Nov 21 '18 at 8:27











  • Uninstall pip , delete pip folders and build pip using python3.6

    – Yash Kumar Atri
    Nov 21 '18 at 10:31














4












4








4


1






Default python3 on Ubuntu 14.04 is of 3.4.3 but I want to use 3.6.3 instead.



I followed commands below to install 3.6.3:



$ sudo apt-get update
$ sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
$ sudo apt-get install python3-pip python3-dev

$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt-get update
$ sudo apt-get install python3.6


3.6.3 was then available on my Ubuntu:



$ which python3.6
/usr/bin/python3.6


For sure, python3 was still pointing to 3.4.3:



$ ls -la /usr/bin/python3
/usr/bin/python3 -> /usr/bin/python3.4


pip3 was available but it used 3.4.3 instead of 3.6.3 (what I wanted):



$ pip3 --version
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)


I thought updating /usr/bin/python3 would solve the issue so I did adjusting the python3 symbolic link making it point to 3.6.3:



$ sudo unlink /usr/bin/python3
$ sudo ln -s /usr/bin/python3.6 /usr/bin/python3
$ ls -la /usr/bin/python3
/usr/bin/python3 -> /usr/bin/python3.6


But pip3 didn't work anymore :(



$ pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'


UPDATED



I tried with some suggestions:



$ sudo python3.6 -m pip


and



$ curl https://bootstrap.pypa.io/get-pip.py | sudo -H python3.6


But it showed very similar output:



Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 59, in <module>
from pip.log import logger
File "/usr/lib/python3/dist-packages/pip/log.py", line 9, in <module>
import colorama, pkg_resources
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg


How can I solve the issue?










share|improve this question
















Default python3 on Ubuntu 14.04 is of 3.4.3 but I want to use 3.6.3 instead.



I followed commands below to install 3.6.3:



$ sudo apt-get update
$ sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
$ sudo apt-get install python3-pip python3-dev

$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt-get update
$ sudo apt-get install python3.6


3.6.3 was then available on my Ubuntu:



$ which python3.6
/usr/bin/python3.6


For sure, python3 was still pointing to 3.4.3:



$ ls -la /usr/bin/python3
/usr/bin/python3 -> /usr/bin/python3.4


pip3 was available but it used 3.4.3 instead of 3.6.3 (what I wanted):



$ pip3 --version
pip 1.5.4 from /usr/lib/python3/dist-packages (python 3.4)


I thought updating /usr/bin/python3 would solve the issue so I did adjusting the python3 symbolic link making it point to 3.6.3:



$ sudo unlink /usr/bin/python3
$ sudo ln -s /usr/bin/python3.6 /usr/bin/python3
$ ls -la /usr/bin/python3
/usr/bin/python3 -> /usr/bin/python3.6


But pip3 didn't work anymore :(



$ pip3 --version
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'


UPDATED



I tried with some suggestions:



$ sudo python3.6 -m pip


and



$ curl https://bootstrap.pypa.io/get-pip.py | sudo -H python3.6


But it showed very similar output:



Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 59, in <module>
from pip.log import logger
File "/usr/lib/python3/dist-packages/pip/log.py", line 9, in <module>
import colorama, pkg_resources
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resources.py", line 1479, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg


How can I solve the issue?







pip ubuntu-14.04 python-3.6 python-3.4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 8:47







duong_dajgja

















asked Nov 21 '18 at 8:20









duong_dajgjaduong_dajgja

1,72611636




1,72611636













  • Use pip3.6, or use python3.6 -m pip.

    – Martijn Pieters
    Nov 21 '18 at 8:22











  • and doesn't Debian / Ubuntu have an alternatives system to switch shared commands?

    – Martijn Pieters
    Nov 21 '18 at 8:23













  • @MartijnPieters I tried with $ sudo python3.6 -m pip but it showed the same error

    – duong_dajgja
    Nov 21 '18 at 8:24











  • Yeah, you really don't want to mess about with the Ubuntu package management. At the very least, reinstall the python packages.

    – Martijn Pieters
    Nov 21 '18 at 8:27











  • Uninstall pip , delete pip folders and build pip using python3.6

    – Yash Kumar Atri
    Nov 21 '18 at 10:31



















  • Use pip3.6, or use python3.6 -m pip.

    – Martijn Pieters
    Nov 21 '18 at 8:22











  • and doesn't Debian / Ubuntu have an alternatives system to switch shared commands?

    – Martijn Pieters
    Nov 21 '18 at 8:23













  • @MartijnPieters I tried with $ sudo python3.6 -m pip but it showed the same error

    – duong_dajgja
    Nov 21 '18 at 8:24











  • Yeah, you really don't want to mess about with the Ubuntu package management. At the very least, reinstall the python packages.

    – Martijn Pieters
    Nov 21 '18 at 8:27











  • Uninstall pip , delete pip folders and build pip using python3.6

    – Yash Kumar Atri
    Nov 21 '18 at 10:31

















Use pip3.6, or use python3.6 -m pip.

– Martijn Pieters
Nov 21 '18 at 8:22





Use pip3.6, or use python3.6 -m pip.

– Martijn Pieters
Nov 21 '18 at 8:22













and doesn't Debian / Ubuntu have an alternatives system to switch shared commands?

– Martijn Pieters
Nov 21 '18 at 8:23







and doesn't Debian / Ubuntu have an alternatives system to switch shared commands?

– Martijn Pieters
Nov 21 '18 at 8:23















@MartijnPieters I tried with $ sudo python3.6 -m pip but it showed the same error

– duong_dajgja
Nov 21 '18 at 8:24





@MartijnPieters I tried with $ sudo python3.6 -m pip but it showed the same error

– duong_dajgja
Nov 21 '18 at 8:24













Yeah, you really don't want to mess about with the Ubuntu package management. At the very least, reinstall the python packages.

– Martijn Pieters
Nov 21 '18 at 8:27





Yeah, you really don't want to mess about with the Ubuntu package management. At the very least, reinstall the python packages.

– Martijn Pieters
Nov 21 '18 at 8:27













Uninstall pip , delete pip folders and build pip using python3.6

– Yash Kumar Atri
Nov 21 '18 at 10:31





Uninstall pip , delete pip folders and build pip using python3.6

– Yash Kumar Atri
Nov 21 '18 at 10:31












1 Answer
1






active

oldest

votes


















3














Hi the real problem is described here: https://stackoverflow.com/a/41722610/7933710
TLDR: Using a ppa on older Ubuntu systems is not consistent.



To repair your system you'll have to remove python3.6:



apt-get remove --purge python3.6
add-apt-repository -r ppa:jonathonf/python-3.6


Then download the source and build from source and prepare the system for building:



wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tgz


Now prep the system for building:



apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev  libncursesw5-dev xz-utils tk-dev


All these steps are from the guide here https://realpython.com/installing-python/#compiling-python-from-source



Now configure, make, make altinstall (important)



tar xvf Python-3.6.7.tgz
cd Python-3.6.7/
./configure --enable-optimizations --with-ensurepip=install
make -j 8
make altinstall



The -j 8 means run on 8 cores. Of course if you have less then use the appropriate number. It will not cause a crash in any case.




Now verify the install by runnning



python3.6 -V
which python3.6


Copy the path of python3.6, it should be either /usr/bin/python3.6 or /usr/local/bin/python3.6



You can now use the update-alternatives to manage all python versions on your machine



ls /usr/bin/python*  # e.g. /usr/bin/python2.7 /usr/bin/python3.4 /usr/bin/python3.6
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 2


The number 2 signifies the priority for running python on your machine. In this case 2 > 1, so you'll prefer python3.6. If you want to change to version 3.4 you can just run update-alternatives --config python which is an interactive configurator.



Now you can use python -m pip -V to verify pip is working correctly. You can also use pip3.6 to install packages.






share|improve this answer


























  • works for me. thanks!

    – duong_dajgja
    Nov 21 '18 at 14:39











  • This is an excellent guide. One quick piece of advice: I had to sudo to run make altinstall. any reason why?

    – physincubus
    Jan 17 at 5:40








  • 1





    also, to everyone out there, the --enable-optimizations flag is giving me errors per stackoverflow.com/questions/47011941/…

    – physincubus
    Jan 17 at 5:47











  • @physincubus I suppose the target dir for the make altinstall is not owned by the user who executes the command. As why the errors occur, I think it's the same reason. A workaround would be to elevate to root with sudo su -, although this is frowned upon :D

    – Borisu
    Jan 17 at 14:57











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407801%2fhow-can-i-adjust-pip3-using-python3-6-not-python3-4-on-ubuntu-14-04%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














Hi the real problem is described here: https://stackoverflow.com/a/41722610/7933710
TLDR: Using a ppa on older Ubuntu systems is not consistent.



To repair your system you'll have to remove python3.6:



apt-get remove --purge python3.6
add-apt-repository -r ppa:jonathonf/python-3.6


Then download the source and build from source and prepare the system for building:



wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tgz


Now prep the system for building:



apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev  libncursesw5-dev xz-utils tk-dev


All these steps are from the guide here https://realpython.com/installing-python/#compiling-python-from-source



Now configure, make, make altinstall (important)



tar xvf Python-3.6.7.tgz
cd Python-3.6.7/
./configure --enable-optimizations --with-ensurepip=install
make -j 8
make altinstall



The -j 8 means run on 8 cores. Of course if you have less then use the appropriate number. It will not cause a crash in any case.




Now verify the install by runnning



python3.6 -V
which python3.6


Copy the path of python3.6, it should be either /usr/bin/python3.6 or /usr/local/bin/python3.6



You can now use the update-alternatives to manage all python versions on your machine



ls /usr/bin/python*  # e.g. /usr/bin/python2.7 /usr/bin/python3.4 /usr/bin/python3.6
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 2


The number 2 signifies the priority for running python on your machine. In this case 2 > 1, so you'll prefer python3.6. If you want to change to version 3.4 you can just run update-alternatives --config python which is an interactive configurator.



Now you can use python -m pip -V to verify pip is working correctly. You can also use pip3.6 to install packages.






share|improve this answer


























  • works for me. thanks!

    – duong_dajgja
    Nov 21 '18 at 14:39











  • This is an excellent guide. One quick piece of advice: I had to sudo to run make altinstall. any reason why?

    – physincubus
    Jan 17 at 5:40








  • 1





    also, to everyone out there, the --enable-optimizations flag is giving me errors per stackoverflow.com/questions/47011941/…

    – physincubus
    Jan 17 at 5:47











  • @physincubus I suppose the target dir for the make altinstall is not owned by the user who executes the command. As why the errors occur, I think it's the same reason. A workaround would be to elevate to root with sudo su -, although this is frowned upon :D

    – Borisu
    Jan 17 at 14:57
















3














Hi the real problem is described here: https://stackoverflow.com/a/41722610/7933710
TLDR: Using a ppa on older Ubuntu systems is not consistent.



To repair your system you'll have to remove python3.6:



apt-get remove --purge python3.6
add-apt-repository -r ppa:jonathonf/python-3.6


Then download the source and build from source and prepare the system for building:



wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tgz


Now prep the system for building:



apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev  libncursesw5-dev xz-utils tk-dev


All these steps are from the guide here https://realpython.com/installing-python/#compiling-python-from-source



Now configure, make, make altinstall (important)



tar xvf Python-3.6.7.tgz
cd Python-3.6.7/
./configure --enable-optimizations --with-ensurepip=install
make -j 8
make altinstall



The -j 8 means run on 8 cores. Of course if you have less then use the appropriate number. It will not cause a crash in any case.




Now verify the install by runnning



python3.6 -V
which python3.6


Copy the path of python3.6, it should be either /usr/bin/python3.6 or /usr/local/bin/python3.6



You can now use the update-alternatives to manage all python versions on your machine



ls /usr/bin/python*  # e.g. /usr/bin/python2.7 /usr/bin/python3.4 /usr/bin/python3.6
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 2


The number 2 signifies the priority for running python on your machine. In this case 2 > 1, so you'll prefer python3.6. If you want to change to version 3.4 you can just run update-alternatives --config python which is an interactive configurator.



Now you can use python -m pip -V to verify pip is working correctly. You can also use pip3.6 to install packages.






share|improve this answer


























  • works for me. thanks!

    – duong_dajgja
    Nov 21 '18 at 14:39











  • This is an excellent guide. One quick piece of advice: I had to sudo to run make altinstall. any reason why?

    – physincubus
    Jan 17 at 5:40








  • 1





    also, to everyone out there, the --enable-optimizations flag is giving me errors per stackoverflow.com/questions/47011941/…

    – physincubus
    Jan 17 at 5:47











  • @physincubus I suppose the target dir for the make altinstall is not owned by the user who executes the command. As why the errors occur, I think it's the same reason. A workaround would be to elevate to root with sudo su -, although this is frowned upon :D

    – Borisu
    Jan 17 at 14:57














3












3








3







Hi the real problem is described here: https://stackoverflow.com/a/41722610/7933710
TLDR: Using a ppa on older Ubuntu systems is not consistent.



To repair your system you'll have to remove python3.6:



apt-get remove --purge python3.6
add-apt-repository -r ppa:jonathonf/python-3.6


Then download the source and build from source and prepare the system for building:



wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tgz


Now prep the system for building:



apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev  libncursesw5-dev xz-utils tk-dev


All these steps are from the guide here https://realpython.com/installing-python/#compiling-python-from-source



Now configure, make, make altinstall (important)



tar xvf Python-3.6.7.tgz
cd Python-3.6.7/
./configure --enable-optimizations --with-ensurepip=install
make -j 8
make altinstall



The -j 8 means run on 8 cores. Of course if you have less then use the appropriate number. It will not cause a crash in any case.




Now verify the install by runnning



python3.6 -V
which python3.6


Copy the path of python3.6, it should be either /usr/bin/python3.6 or /usr/local/bin/python3.6



You can now use the update-alternatives to manage all python versions on your machine



ls /usr/bin/python*  # e.g. /usr/bin/python2.7 /usr/bin/python3.4 /usr/bin/python3.6
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 2


The number 2 signifies the priority for running python on your machine. In this case 2 > 1, so you'll prefer python3.6. If you want to change to version 3.4 you can just run update-alternatives --config python which is an interactive configurator.



Now you can use python -m pip -V to verify pip is working correctly. You can also use pip3.6 to install packages.






share|improve this answer















Hi the real problem is described here: https://stackoverflow.com/a/41722610/7933710
TLDR: Using a ppa on older Ubuntu systems is not consistent.



To repair your system you'll have to remove python3.6:



apt-get remove --purge python3.6
add-apt-repository -r ppa:jonathonf/python-3.6


Then download the source and build from source and prepare the system for building:



wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tgz


Now prep the system for building:



apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev  libncursesw5-dev xz-utils tk-dev


All these steps are from the guide here https://realpython.com/installing-python/#compiling-python-from-source



Now configure, make, make altinstall (important)



tar xvf Python-3.6.7.tgz
cd Python-3.6.7/
./configure --enable-optimizations --with-ensurepip=install
make -j 8
make altinstall



The -j 8 means run on 8 cores. Of course if you have less then use the appropriate number. It will not cause a crash in any case.




Now verify the install by runnning



python3.6 -V
which python3.6


Copy the path of python3.6, it should be either /usr/bin/python3.6 or /usr/local/bin/python3.6



You can now use the update-alternatives to manage all python versions on your machine



ls /usr/bin/python*  # e.g. /usr/bin/python2.7 /usr/bin/python3.4 /usr/bin/python3.6
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 2


The number 2 signifies the priority for running python on your machine. In this case 2 > 1, so you'll prefer python3.6. If you want to change to version 3.4 you can just run update-alternatives --config python which is an interactive configurator.



Now you can use python -m pip -V to verify pip is working correctly. You can also use pip3.6 to install packages.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 17 at 14:58

























answered Nov 21 '18 at 13:35









BorisuBorisu

536312




536312













  • works for me. thanks!

    – duong_dajgja
    Nov 21 '18 at 14:39











  • This is an excellent guide. One quick piece of advice: I had to sudo to run make altinstall. any reason why?

    – physincubus
    Jan 17 at 5:40








  • 1





    also, to everyone out there, the --enable-optimizations flag is giving me errors per stackoverflow.com/questions/47011941/…

    – physincubus
    Jan 17 at 5:47











  • @physincubus I suppose the target dir for the make altinstall is not owned by the user who executes the command. As why the errors occur, I think it's the same reason. A workaround would be to elevate to root with sudo su -, although this is frowned upon :D

    – Borisu
    Jan 17 at 14:57



















  • works for me. thanks!

    – duong_dajgja
    Nov 21 '18 at 14:39











  • This is an excellent guide. One quick piece of advice: I had to sudo to run make altinstall. any reason why?

    – physincubus
    Jan 17 at 5:40








  • 1





    also, to everyone out there, the --enable-optimizations flag is giving me errors per stackoverflow.com/questions/47011941/…

    – physincubus
    Jan 17 at 5:47











  • @physincubus I suppose the target dir for the make altinstall is not owned by the user who executes the command. As why the errors occur, I think it's the same reason. A workaround would be to elevate to root with sudo su -, although this is frowned upon :D

    – Borisu
    Jan 17 at 14:57

















works for me. thanks!

– duong_dajgja
Nov 21 '18 at 14:39





works for me. thanks!

– duong_dajgja
Nov 21 '18 at 14:39













This is an excellent guide. One quick piece of advice: I had to sudo to run make altinstall. any reason why?

– physincubus
Jan 17 at 5:40







This is an excellent guide. One quick piece of advice: I had to sudo to run make altinstall. any reason why?

– physincubus
Jan 17 at 5:40






1




1





also, to everyone out there, the --enable-optimizations flag is giving me errors per stackoverflow.com/questions/47011941/…

– physincubus
Jan 17 at 5:47





also, to everyone out there, the --enable-optimizations flag is giving me errors per stackoverflow.com/questions/47011941/…

– physincubus
Jan 17 at 5:47













@physincubus I suppose the target dir for the make altinstall is not owned by the user who executes the command. As why the errors occur, I think it's the same reason. A workaround would be to elevate to root with sudo su -, although this is frowned upon :D

– Borisu
Jan 17 at 14:57





@physincubus I suppose the target dir for the make altinstall is not owned by the user who executes the command. As why the errors occur, I think it's the same reason. A workaround would be to elevate to root with sudo su -, although this is frowned upon :D

– Borisu
Jan 17 at 14:57




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407801%2fhow-can-i-adjust-pip3-using-python3-6-not-python3-4-on-ubuntu-14-04%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Guess what letter conforming each word

Port of Spain

Run scheduled task as local user group (not BUILTIN)