I have two versions of Python in my laptop. Python 2.7 and Python 3.6. If install a module this is installed only in Python 3.6.
I would like to install modules in Python 2.7 through pip but I don't know how to do it.
I want to install right now GDAL and Fiona for Python 2.7 in Ubuntu 17.04.Answer1:
If Python 2.7 is well installed on your system, you should have
python2.7 commands and you could run the following:
python2.7 -m pip install <your-packages>
To make sure you are running the correct python version, you can use
Better use virtual environment for this. Follow this link <a href="https://realpython.com/blog/python/python-virtual-environments-a-primer/" rel="nofollow">https://realpython.com/blog/python/python-virtual-environments-a-primer/</a>
You can set python version to use in virtual env using
virtualenv -p path/to/python2.7 env_name
Activate this env using
. env_name/bin/activate then,
pip install package_name to install libraries inside virtual environment