Re: Error Loading Weewx for the First Time

1,005 views
Skip to first unread message

Mark Jenks

unread,
Dec 28, 2012, 8:28:05 AM12/28/12
to weewx...@googlegroups.com
I would look to make sure that the user you are using for mysql has the access it needs.

-Mark

On Friday, December 28, 2012 7:17:34 AM UTC-6, Bill Pattison wrote:
I am trying to bring weewx up for the first time on my server - Ubuntu 12.04.  I think I have followed the Debian Quick Start Guide completely but I am getting the following messages when trying to start weewx:

jwp@jwp-srvr:/home/weewx$ ./bin/weewxd.py weewx.conf
Traceback (most recent call last):
  File "./bin/weewxd.py", line 68, in <module>
    weewx.wxengine.main(options, args)
  File "/home/weewx/bin/weewx/wxengine.py", line 836, in main
    engine = EngineClass(config_dict)
  File "/home/weewx/bin/weewx/wxengine.py", line 67, in __init__
    self.loadServices(config_dict)
  File "/home/weewx/bin/weewx/wxengine.py", line 121, in loadServices
    self.service_obj.append(weeutil.weeutil._get_object(svc, self, config_dict))
  File "/home/weewx/bin/weeutil/weeutil.py", line 653, in _get_object
    obj = mod(*args, **kwargs)
  File "/home/weewx/bin/weewx/wxengine.py", line 414, in __init__
    self.setupArchiveDatabase(config_dict)
  File "/home/weewx/bin/weewx/wxengine.py", line 506, in setupArchiveDatabase
    user.schemas.defaultArchiveSchema)
  File "/home/weewx/bin/weewx/archive.py", line 91, in open_with_create
    archive = Archive.open(archive_db_dict, table)
  File "/home/weewx/bin/weewx/archive.py", line 73, in open
    _connect = weedb.connect(archive_db_dict)
  File "/home/weewx/bin/weedb/__init__.py", line 42, in connect
    __import__(db_dict['driver'])
  File "/home/weewx/bin/weedb/mysql.py", line 14, in <module>
    import MySQLdb
ImportError: No module named MySQLdb

Any suggestions on what I am doing wrong or what additional steps I need to take? I am trying to set it up to use MySQL and have created the two different databases.

Thanks

Bill Pattison

unread,
Dec 28, 2012, 8:46:57 AM12/28/12
to weewx...@googlegroups.com
Thanks Mark.  Yes the mysql user I am using have full access to do everything.

Mark Jenks

unread,
Dec 28, 2012, 8:57:28 AM12/28/12
to weewx...@googlegroups.com
Missed this the first glance..  

  File "/home/weewx/bin/weedb/mysql.py", line 14, in <module>
    import MySQLdb
ImportError: No module named MySQLdb

Make sure you have mysql support added to python.

Thomas Keffer

unread,
Dec 28, 2012, 9:16:17 AM12/28/12
to weewx...@googlegroups.com
Exactly right. If you are planning to use MySQL instead of the default sqlite, you will need its Python adapter (as well as MySQL itself). Install it with:

sudo apt-get install python-mysqldb

Details are in the User's Guide.

-tk

--
 
 



--
Tom Keffer
kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer

Bill Pattison

unread,
Dec 28, 2012, 9:30:23 AM12/28/12
to weewx...@googlegroups.com
Mark, I did the steps in the Debian start up instructions - 

Install the required libraries:

sudo apt-get install python-configobj 
sudo apt-get install python-serial 
sudo apt-get install python-cheetah 
sudo apt-get install python-imaging 

If you wish to install the optional package pyephem for extended almanac information, then add:

sudo apt-get install python-dev
sudo apt-get install python-pip 
sudo pip install pyephem 


Although experienced with mysql using php and perl, one of the reasons I selected weewx is that I have no experience with Python and would like to learn it.   I have used the MySQL Server with my web site for years.  I just also loaded the MySQL Client from the Ubuntu Software Center and tried again but got the same errors.Is there something else I need to do to add mysql support to Python?  I didn't find anything that looked like a logical choice in the Ubuntu Software Center.

Bill Pattison

unread,
Dec 28, 2012, 10:29:05 AM12/28/12
to weewx...@googlegroups.com
Thank you Sir !!!  It is now loading the last three months of data from my Vantage Pro

john st harmon weather

unread,
Nov 27, 2013, 6:15:00 AM11/27/13
to weewx...@googlegroups.com
I have now been running weewx with default database for a couple months since its initial installation but wanted to change to mysql as I am better geared up to handle mysql. However, ran into exactly the same problems, so thanks for this post which, although essentially a ubuntu issue has saved probably many hours of frustration. Like Bill weewx is now happily loading all the data from the Davis logger.
Reply all
Reply to author
Forward
0 new messages