2

I'm running a Debian VM (4.9.189-3+deb9u1) on the Google cloud. I want to run a script on this instance; the script works fine on my local machine (Mac OSX Mojave 10.14.6; python 3.6.8). However, when I run it on the VM I get an error that seems to relate to the fact that my the VM runs python 3.4 when the script needs python 3.6+.

Here's the problem. When I run python -V, the response is Python 3.7.4. However, when I try to install the library supporting the script I want to run

    pip3 install --user --upgrade -e 
    git+https://github.com/twintproject/twint.git@origin/master#egg=twint

I get

twint requires Python '>=3.6.0' but the running Python is 3.5.3.

I have tried changing the default python as detailed here; this doesn't seem to work––in fact, python 3.6 isn't even visible as an option when I query ls /usr/bin/python*. Can anyone offer some advice on how to proceed here? Thanks.

Lodore66
  • 1,125
  • 4
  • 16
  • 34

1 Answers1

1

It seems like you have multiple Python versions available. If python -V gives you Python 3.7.4, you can use:

$ python -m pip install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint

to invoke pip from that same Python interpreter.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
  • Thanks for this! In the end, the easiest solution turned out to be installing anaconda and making that the default python; for whatever reason, this was much easier than doing an install of python on its own, and also made the dependencies much easier to work with, too. – Lodore66 Oct 07 '19 at 20:01