-1

I have both versions, but when I used pip to download lxml it apparently got installed in 2.7, how can I specify the installation path?

$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
David Andrei Ned
  • 799
  • 1
  • 11
  • 28

2 Answers2

1

You can try

python3 -m pip install lxml

or

pip3 install lxml

Alex Luis Arias
  • 1,313
  • 1
  • 14
  • 27
1

Have you installed the versions via Anaconda environments(link is an example on how to, the question is for Mac, but the answer should apply for everything) ?

If so, you need to first activate the environment for the respective version (e.g. if conda create -n py3 Python=3 created the environment, give activate py3 before pip install)

if not, 1. you should consider anaconda 2. you need to check which python version is in the path. I am guessing there are two python executables at two separate folders. Check your path. Try running 'which python' to see which python is executed. In each of the two folders there is a pip executable. You need to run the one that is in the Python 3 installation.

Community
  • 1
  • 1
ntg
  • 12,950
  • 7
  • 74
  • 95