Forums

Module installed but website not recognizing it

I would like to run bls module. I did "pip install bls --user" in the bash console and it seems to install fine. I’ve also tried “pip3.8 install bls –user” to make sure I’m using the same pip/python version as I’m running in my website. I get “requirement already satisfied”. But when I run my website I get this error

2020-07-27 10:02:46,924: Error running WSGI application 
2020-07-27 10:02:46,925: ModuleNotFoundError: No module named 'bls' 
2020-07-27 10:02:46,925:   File "/var/www/costarica_pythonanywhere_com_wsgi.py", line 16, in <module>
2020-07-27 10:02:46,925:     from flask_app import app as application  # noqa 
2020-07-27 10:02:46,925:  
2020-07-27 10:02:46,925:   File "/home/CostaRica/mysite/flask_app.py", line 3, in <module> 
2020-07-27 10:02:46,926:     from processing import getIndex 
2020-07-27 10:02:46,926:  
2020-07-27 10:02:46,926:   File "/home/CostaRica/mysite/processing.py", line 1, in <module> 
2020-07-27 10:02:46,926:     import bls

It seems the website hasn’t found the bls module I thought I imported. Any advice?

I saw a couple of questions that were similar. That’s where I tried changing the pip version, but that doesn’t seem to solve it or I’m not correctly changing the pip/python version in my bash console.

It looks like your website is using Python 3.7 -- you can check what you configured it with on the "Web" tab -- so you need to use pip3.7 install --user bls

You're right it is 3.7. I entered that pip command and says its already satisfied the request. When i try to run i get same error as above. Still looks like i'm doing something wrong. Any other ideas?

$ pip3.7 install --user bls
Looking in links: /usr/share/pip-wheels
Requirement already satisfied: requests in /usr/lib/python3.7/site-packages (from bls) (2.22.0)
Requirement already satisfied: pandas in /usr/lib/python3.7/site-packages (from bls) (0.25.2)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3.7/site-packages (from requests->bls) (1.24.3)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.7/site-packages (from requests->bls) (2019.9.11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3.7/site-packages (from requests->bls) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python3.7/site-packages (from requests->bls) (2.8)
Requirement already satisfied: numpy>=1.13.3 in /usr/lib/python3.7/site-packages (from pandas->bls) (1.17.3)
Requirement already satisfied: pytz>=2017.2 in /usr/lib/python3.7/site-packages (from pandas->bls) (2019.3)
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/lib/python3.7/site-packages (from pandas->bls) (2.8.0)
Requirement already satisfied: six>=1.5 in /usr/lib/python3.7/site-packages (from python-dateutil>=2.6.1->pandas->bls) (1.12.0)

are you sure that's the error that you are seeing?

check your webapp error logs, and make sure you are looking at the most recent error message.

Sorry, yes it is working now. I must have been overlooking a few things including the right error message. Thank you!