cancel
Showing results for 
Search instead for 
Did you mean: 

Imported Python package 'requests' not recognized.

SOLVED
New Contributor

Imported Python package 'requests' not recognized.

I am using TestComplete version 14.60.274.7 x64, and I am attempting to use a third party Python package in my code.  I have done the following:

 

    - Pulled Python package named requests (x64 version) using pip install, and placed it in the following folder:

              C:\Program Files (x86)\SmartBear\TestComplete 14\Bin\Extensions\Python\Python36\Lib

 

    - Added an import statement to my script:

             import requests

 

I receive the following error when running my script: 

        ModuleNotFoundError: No module names 'requests'

 

I have also tried an alternative method to have the package recognized by adding the following to my script:

        from os import sys
        sys.path.insert(0, "C:\\Program Files (x86)\\SmartBear\\TestComplete 14\\Bin\\Extensions\\Python\\Python36\\Lib\\requests")

 

Neither of these two methods will allow the requests package to be recognized.  Can anyone provide guidance on how to solve my issue? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Staff

Re: Imported Python package 'requests' not recognized.

from os import sys
sys.path.insert(0, 'C:\\Users\\justin.kim\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages')

the full path should be the directory where your modules go when you download with 'pip install'.

so you dont need to manually copy and paste the "requests" module.

Best,
Justin Kim

View solution in original post

2 REPLIES 2
Staff

Re: Imported Python package 'requests' not recognized.

from os import sys
sys.path.insert(0, 'C:\\Users\\justin.kim\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages')

the full path should be the directory where your modules go when you download with 'pip install'.

so you dont need to manually copy and paste the "requests" module.

Best,
Justin Kim

View solution in original post

New Contributor

Re: Imported Python package 'requests' not recognized.

That worked great!  Thank you for your quick response.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors