0

I have two versions of Python in my /usr/bin directory. Python2.7 and Python3.6. Entering "Python --version" in a terminal I get "Python 2.7.15" back. I'd like to add watson_developer_cloud to 2.7. However when I enter

pip install watson_developer_cloud

watson_developer_cloud shows up in /usr/lib/Python3.6 and not /usr/lib/Python2.7.

Question: How do I get watson_developer_cloud in Python2.7?

I am trying to get Watson speech-to-text configured to use sttClient.py. Thanks in advance.

portsample
  • 1,986
  • 4
  • 19
  • 35
  • Use `python -m pip install watson_developer_cloud` – pulkit-singhal Jun 06 '18 at 16:38
  • You may try `pip2` or `pip2.7` commands, check if it is available. But maybe you will need to install it, since pip3 and pip2 are whole different package managers. – marcelotokarnia Jun 06 '18 at 16:43
  • "python -m pip install watson_developer_cloud" returns, "no module named pip". – portsample Jun 06 '18 at 16:46
  • Possible duplicate of [pip: dealing with multiple Python versions?](https://stackoverflow.com/questions/2812520/pip-dealing-with-multiple-python-versions) – phd Jun 06 '18 at 17:41

1 Answers1

0

You can tell pip which version of python you wish to use:

#Install x library using python 2.7
$ python-2,7 -m pip install x

It seems that is is the best recommendation since it supports all versions of Python, and in all forms of virtualenv. You can read more about this here: pip: dealing with multiple Python versions?

Daniel Lara
  • 52
  • 1
  • 7
  • "python2.7 -m pip install watson_developer_cloud" returns "/usr/bin/python2.7: No module named pip" – portsample Jun 06 '18 at 16:51
  • Okay, now I've got both pip2 and pip3 packages (v10.0.1-1-1) installed. Unclear to me why there are separate packages for Python2 and Python3. Watson developer cloud installed fine in /usr/lib/Python2.7.15. Thanks. – portsample Jun 06 '18 at 20:55