3

I am new to python and ubuntu to be fair. I have been recently following a couple of tutorials and they use pylint to check the syntax of the python code.

I've installed it as normal through the terminal using 'sudo pip3 install pylint', however whenever I format in VS Code I get an error stating pylint does not exist, do I want to install. On the attempt to install, i get another error due to pip not existing.

I've looked in the terminal after attempting to reinstall pip and pylint, however it's going to the python3.6 folder and not python3.7 folder, hence the errors.

Any ideas on how to resolve this?

Pip output is currently: "pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)"

If i try to install pylint via the terminal using "python3 -m pip install pylint", I get the output error of: "/usr/local/bin/python3: No module named pip"

Nick Bull
  • 1,099
  • 10
  • 23
  • 1
    [Edit] your Question and show the output of `pip3 --version` – stovfl Mar 02 '19 at 10:17
  • Relevant [mess-with-multiple-versions-of-pip-to-install](https://stackoverflow.com/questions/44723844/mess-with-multiple-versions-of-pip-to-install-numpy) – stovfl Mar 02 '19 at 10:22
  • 1
    @stovfl I have added the output and it's currently: "pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)" – Nick Bull Mar 02 '19 at 10:39
  • Next check the output of `python3 --version` if `3.7` do `/usr/bin/python3 -m pip install pylint`. – stovfl Mar 02 '19 at 10:47
  • 1
    I've just checked and python3 outputs as 3.7, but the /usr/bin/python3 is 3.6, hence why the install is going there. Can i remove 3.6? would that be easier? 3.7 is in folder: /usr/local/bin/python3 but running the pip install fails due to pip not existing. I'm trying to install pip there with sudo apt install /usr/local/bin/python3-pip but that fails too – Nick Bull Mar 02 '19 at 11:06
  • Have you verified the current Python version in the left corner of VSCode? – Masoud Rahimi Mar 02 '19 at 11:25

1 Answers1

2

After following stovfl's suggestions i realised that python 3 needed redirecting to the 3.7 install

I googled and found this article: http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/

At step 3, it tells you how to makepython3 use the new install with the following command:

sudo update-alternatives --install /usr/local/bin/python3 python3 /usr/bin/python3.7 1

Now when I intall pip and pylint it directs to the new 3.7 folder. Meaning it also works as intended with VS Code.

Nick Bull
  • 1,099
  • 10
  • 23