简体   繁体   中英

How to install packages on Linux for Python 2 with pip when Python 3 is installed

I'm trying to install a package for python 2 using pip, however it defaults to installing for python 3. The script I need to run only works in python 2.7, which i do have installed alongside python 3. The pip-2.7 command does not exist, nor pip2. Is there a way besides that to directly install the package? (hexdump, btw if that helps).

Did you checked if Python2 is installed?

Did you tried pip2 command?

What's the result if you do which pip ?

if pip2 or pip2.7 don't work, you can try /usr/bin/pip2 or /usr/bin/pip2.7

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM