Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

Python ModuleNotFoundError although module is installed [aiohttp]

hi there, im new to all this and been trying to get as far as i can by myself but ran into a wall that got me stuck.

i installed aiohttp using

pip install aiohttp

also, before trying to run my script i used

pip install -r requirements.txt

and got the 'already satisfied' result, but i still get the error msg

ModuleNotFoundError: No module named 'aiohttp'

i noticed similar questions were posted in the past but the replies seem to be specific to the scripts\modules the posts were referring to, and not to aiohttp so i did not find an answer to my problem (or did not manage to understand it).

id love some tips. this is the script im using: https://github.com/J3Patel/linkedin-learning-video-downloader

3 Replies
Highlighted
Commander Lvl 2
Message 2 of 4

Re: Python ModuleNotFoundError although module is installed [aiohttp]

Did you check your PYTHONPATH value? Can aiohttp be found on that path? 

 

Python 2 or 3 ?

 

Please follow-up to let us know how you made out. For good karma, mark a reply as the answer if it helped!

Copilot Lvl 2
Message 3 of 4

Re: Python ModuleNotFoundError although module is installed [aiohttp]

i'm not sure how to find that out.

i know i have python in path and when i check sys.path i see the libraries but i dont know what to conclude from that. how do i check if aiohttp can be found on that path?

 

im using python3.7

Commander Lvl 2
Message 4 of 4

Re: Python ModuleNotFoundError although module is installed [aiohttp]


i know i have python in path and when i check sys.path i see the libraries

 

Um. Sounds like you know more python than I do!

 

PYTHONPATH and PYTHONHOME are environment variables. I.e. things you check in terminal or command prompt (depending on whether you are using Linux/OSX or Windows, respectively). In a Windows command prompt you would type 'set' and look for the value of PYTHONPATH. It might not exist.

 

(Windows) If I do a "pip install", the package is installed in "lib\site-packages" under the python folder. If I "print (sys.path)", I see "lib\site-packages" as one of the entries, and I can expect "import <package>" to work.  If I run "python -S" and "print (sys.path)", then "lib\site-packages" is NOT listed, and import will fail.

 

If python is not finding aiohttp, then it might be installed somewhere unexpected. You should be able to use PYTHONPATH to point that path, and sys.path will be updated accordingly when you next run python.

 

I've been bitten in the past when I have both python2 and python3 installed. In that case, I type "python3" to start python 3.x, and have to use "pip3" to install libraries for python 3.x.

 

Please follow-up to let us know how you made out. For good karma, mark a reply as the answer if it helped!