How to install requests module in Python 3.4, instead of 2.7

前端 未结 5 711
耶瑟儿~
耶瑟儿~ 2020-12-23 13:53

I have both Python 2.7 and 3.4 installed on my Ubuntu 14.04 machine. I want to install the \'requests\' module so it is accessible from Py3.4.

When I issued p

5条回答
  •  天命终不由人
    2020-12-23 14:06

    You can specify a Python version for pip to use:

    pip3.4 install requests
    

    Python 3.4 has pip support built-in, so you can also use:

    python3.4 -m pip install
    

    If you're running Ubuntu (or probably Debian as well), you'll need to install the system pip3 separately:

    sudo apt-get install python3-pip
    

    This will install the pip3 executable, so you can use it, as well as the earlier mentioned python3.4 -m pip:

    pip3 install requests
    

提交回复
热议问题