There seem no problem in your code. I tried to run it and it successfully completes with the following output:
python jobstore.py
alarms added: 2013-02-07 10:31:10.234000
alarms added: 2013-02-07 10:31:15.240000
alarms added: 2013-02-07 10:31:20.240000
The only change I made was updating _dbURL = 'sqlite:///:memory:'
to use sqlite engine.
Please check do you have sqlalchemy installed and it can be found in PYTHONPATH by your script. Run the following code in python console or better add it at the beginning of your script and check the output.
import sqlalchemy
print sqlalchemy.__version__
UPDATE I reread your post and realized that my test code had one more difference - I created file with another name: jobstore.py
I tried to rename file to sqlalchemy.py and got same exception:
Traceback (most recent call last):
File "C:/stackoverflow/so/sqlalchemy.py", line 22, in <module>
scheduler.add_jobstore(SQLAlchemyJobStore(url=_dbURL), 'default')
File "C:\Progs\Python27\lib\site-packages\apscheduler\jobstores\sqlalchemy_store.py", line 29, in __init__
self.engine = create_engine(url)
NameError: global name 'create_engine' is not defined
Process finished with exit code 1
Basically the problem is that your python script name has same name as sqlalchemy module name thus python loads your scripts first and cannot access sqlalchemy code.
Try to rename script name to something other then sqlalchemy.py
- this would help if you have sqlalchemy module installed.