Python Forum

Full Version: Help with apscheduler
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Gettinf the following error when running software for SwitchDoc's GroveWeatherPi:

Error:
pi@raspberrypi:~/SDL_Pi_GroveWeatherPi $ sudo python GroveWeatherPi.py Traceback (most recent call last): File "GroveWeatherPi.py", line 55, in <module> from apscheduler.schedulers.background import BackgroundScheduler ImportError: No module named schedulers.background pi@raspberrypi:~/SDL_Pi_GroveWeatherPi $
Below is the code from the software itself:

from apscheduler.schedulers.background import BackgroundScheduler import apscheduler.events # Check for user imports try: import conflocal as config except ImportError: import config if (config.enable_MySQL_Logging == True): import MySQLdb as mdb
I have installed mysql and have tried apscheduler 3.x and 2.x

Still same result. Any help would be greatly appreciated!
do you have file named apscheduler.py in the same folder where the file GroveWeatherPi.py is?
I do not, it is my understanding that apscheduler is an advanced scheduler for python and is installed using a repository. I guess I can try to install while in the directory, but I dont think it will install in the directory, it will just install in the default/root location

Error:
pi@raspberrypi:~/SDL_Pi_GroveWeatherPi $ sudo pip install apscheduler Requirement already satisfied: apscheduler in /usr/local/lib/python2.7/dist-p ackages
Sorry, the point was not to install it in the directory. It happen that people name files like packages they try to use and that file overshadow the package and thus the import error
not sure if it is any help, but below is the link to the github repo.

https://github.com/switchdoclabs/SDL_Pi_GroveWeatherPi
at the moment I don't have other ideas. it says apscheduler is installed for python2, you run it with python2...