Python Forum
Import Requests Does not Work
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Import Requests Does not Work
#12
Two installed versions of Python often do not play nicely with each other, and it seems like you have two installed versions of Python 3. Problems seem to be caused not only by the PATH environment variable, but also by file associations. If this is the case I would suggest either of two approaches:
1. Uninstall both Python Version 3 installations and reinstall Python 3 (takes the least skill).

2. Try the following:
a. In Windows 10, goto Apps and Features and see if you have two versions of Python 3 installed. If so delete one of them.

b. Modify the two Python items in the PATH environment variable per snippsat's post above.

c. Reset the file associations (must be run as adminstrator - Right Click the .bat file and choose 'Run as Administrator'):
In a Windows .bat file
rem #############################################################################
rem #############################################################################
rem Change the line below to reflect your base Python folder
set PythonDIR=C:\Python

rem assoc displays or changes the association between a file extension and a fileType
rem ftype displays or changes the link between a FileType and an executable program
assoc .py=Python.File >NUL
assoc .pyw=PythonW.File >NUL
ftype Python.File="%PythonDIR%\python.exe" %%1 %%* >NUL
ftype PythonW.File="%PythonDIR%\pythonw.exe" %%1 %%* >NUL
Lewis
To paraphrase: 'Throw out your dead' code. https://www.youtube.com/watch?v=grbSQ6O6kbs Forward to 1:00
Reply


Messages In This Thread
Import Requests Does not Work - by DiceMann - Apr-15-2018, 09:17 PM
RE: Import Requests Does not Work - by snippsat - Apr-15-2018, 10:16 PM
RE: Import Requests Does not Work - by DiceMann - Apr-16-2018, 01:44 AM
RE: Import Requests Does not Work - by snippsat - Apr-16-2018, 11:26 AM
RE: Import Requests Does not Work - by DiceMann - Apr-17-2018, 02:16 AM
RE: Import Requests Does not Work - by snippsat - Apr-17-2018, 03:38 AM
RE: Import Requests Does not Work - by DiceMann - Apr-18-2018, 04:35 AM
RE: Import Requests Does not Work - by DiceMann - Apr-20-2018, 04:09 AM
RE: Import Requests Does not Work - by wavic - Apr-20-2018, 04:53 AM
RE: Import Requests Does not Work - by snippsat - Apr-20-2018, 09:07 AM
RE: Import Requests Does not Work - by ljmetzger - Apr-20-2018, 01:18 PM
RE: Import Requests Does not Work - by DiceMann - Apr-24-2018, 02:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pip install requests doesnt work misodca 8 6,979 Jul-07-2023, 08:04 AM
Last Post: zyple
  getting an import statement to work in my program barryjo 1 1,719 Dec-06-2021, 04:28 PM
Last Post: snippsat
  Import requests/beautifulsoup problem Jokadaro_ 3 2,139 Dec-05-2021, 01:22 PM
Last Post: Jokadaro_
  'urllib3' Module not found when import 'requests' spanz 5 10,705 Jan-06-2021, 05:57 PM
Last Post: snippsat
  Does "import xlrd" work in Thonny? cnutakor 3 3,089 Apr-30-2020, 12:41 AM
Last Post: Larz60+
  import scalalib package doesn't work manu_brighter 2 2,988 Apr-17-2020, 06:36 PM
Last Post: snippsat
  [split] import PIL dont work vedansh 1 2,132 Mar-29-2020, 10:00 AM
Last Post: Larz60+
  import PIL dont work rodink 14 13,263 Feb-22-2020, 08:48 PM
Last Post: snippsat
  import requests gives me error blckpstv 1 7,382 Jan-22-2017, 10:41 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020