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

前端 未结 5 679
耶瑟儿~
耶瑟儿~ 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
    
    0 讨论(0)
  • 2020-12-23 14:15

    On Windows with Python v3.6.5

    py -m pip install requests
    
    0 讨论(0)
  • 2020-12-23 14:18

    i just reinstalled the pip and it works, but I still wanna know why it happened...

    i used the apt-get remove --purge python-pip after I just apt-get install pyhton-pip and it works, but don't ask me why...

    0 讨论(0)
  • 2020-12-23 14:21

    i was facing same issue in beautiful soup , I solved this issue by this command , your issue will also get rectified . You are unable to install requests in python 3.4 because your python libraries are not updated . use this command apt-get install python3-requests Just run it will ask you to add 222 MB space in your hard disk , just press Y and wait for completing process, after ending up whole process . check your problem will be resolved.

    0 讨论(0)
  • 2020-12-23 14:23

    Just answering this old thread can be installed without pip On windows or Linux:

    1) Download Requests from https://github.com/kennethreitz/requests click on clone or download button

    2) Unzip the files in your python directory .Exp your python is installed in C:Python\Python.exe then unzip there

    3) Depending on the Os run the following command:

    • Windows use command cd to your python directory location then setup.py install
    • Linux command: python setup.py install

    Thats it :)

    0 讨论(0)
提交回复
热议问题