./bin/weewxd weewx.conf fails with ImportError: No module named configobj

832 views
Skip to first unread message

Thom Rogers

unread,
Feb 16, 2017, 9:50:28 PM2/16/17
to weewx-development
Even though I've successfully installed configobj via the pip install configobj command, when I try to start weewx it errors with "No module named configobj"

Thomas-Rogerss-Mac-mini:weewx chop$ pip install configobj
Collecting configobj
Collecting six (from configobj)
 
Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, configobj
Successfully installed configobj-5.0.6 six-1.10.0

Thomas-Rogerss-Mac-mini:weewx chop$  ./bin/weewxd weewx.conf
Traceback (most recent call last):
 
File "./bin/weewxd", line 14, in <module>
   
import weewx.engine
 
File "/Users/Shared/weewx/bin/weewx/engine.py", line 21, in <module>
   
import configobj
ImportError: No module named configobj

 
I can find configobj wiy\th the locate command:
Thomas-Rogerss-Mac-mini:bin chop$ locate configobj

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/configobj-5.0.6-py2.7.egg




What am I missing here, or doing wrong?


Thom Rogers

unread,
Feb 16, 2017, 9:52:17 PM2/16/17
to weewx-development
BTW my PYTHONPATH is:
 Thomas-Rogerss-Mac-mini:weewx chop$ echo $PYTHONPATH

/usr/local/bin/:/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:/Users/Shared/weewx/bin/:/Library/Frameworks/Python.framework/Versions/2.7/bin

mwall

unread,
Feb 17, 2017, 12:46:09 AM2/17/17
to weewx-development
On Thursday, February 16, 2017 at 9:50:28 PM UTC-5, Thom Rogers wrote:
Even though I've successfully installed configobj via the pip install configobj command, when I try to start weewx it errors with "No module named configobj"

can you import configobj at a python prompt?

Thom Rogers

unread,
Feb 17, 2017, 8:24:19 AM2/17/17
to weewx-development
No.  No luck on that either


>>> import configobj


Traceback (most recent call last):


  File "<stdin>", line 1, in <module>


ImportError: No module named configobj

mwall

unread,
Feb 17, 2017, 8:36:55 AM2/17/17
to weewx-development
On Friday, February 17, 2017 at 8:24:19 AM UTC-5, Thom Rogers wrote:
No.  No luck on that either


>>> import configobj


Traceback (most recent call last):


  File "<stdin>", line 1, in <module>


ImportError: No module named configobj



which python do you get when you invoke the shell?  try these:

python -V

which python

then see which pip:

which pip

and just for fun, see what easy_install you've got:

which easy_install

have you installed homebrew or macports? (or fink - is that still around?)

m

Thom Rogers

unread,
Feb 17, 2017, 2:22:44 PM2/17/17
to weewx-development
Not sure what this tells us, but here's the output of those commands:

Thomas-Rogerss-Mac-mini:weewx chop$ python -V

 

Python 2.7.13

Thomas-Rogerss-Mac-mini:weewx chop$ which python

/usr/local/bin/python

Thomas-Rogerss-Mac-mini:weewx chop$ which pip

/usr/local/bin/pip

Thomas-Rogerss-Mac-mini:weewx chop$ which easy_install

/usr/local/bin/easy_install

Thomas-Rogerss-Mac-mini:weewx chop$

mwall

unread,
Feb 17, 2017, 2:48:55 PM2/17/17
to weewx-development
On Friday, February 17, 2017 at 2:22:44 PM UTC-5, Thom Rogers wrote:
Not sure what this tells us, but here's the output of those commands:

trying to figure out whether you have multiple python installations

did you set PYTHONPATH?

what happens when you run with no PYTHONPATH set?


Vince Skahan

unread,
Feb 17, 2017, 5:04:58 PM2/17/17
to weewx-development
On Friday, February 17, 2017 at 11:48:55 AM UTC-8, mwall wrote:
On Friday, February 17, 2017 at 2:22:44 PM UTC-5, Thom Rogers wrote:
Not sure what this tells us, but here's the output of those commands:

trying to figure out whether you have multiple python installations



Took a quick look on my Mac and came up with a couple ideas too...
  • you might also try  "pip list --format=columns" to see what modules are there
  • is there a  '/usr/bin/python' present ?  If so try "/usr/local/bin/python --version" there too.
  • and 'about this mac' would tell us what version of MacOS they're running
  • and try "brew list" to show what stuff was added that way
My ElCapitan system has /usr/bin/python only, but /usr/local/bin/pip is present, but I have lost recollection of how I installed pip on the Mac unfortunately.

Packaging is painful.  At least it's not a npm package or ruby gem or ....... (sigh....)



 

Thom Rogers

unread,
Feb 17, 2017, 6:51:03 PM2/17/17
to weewx-development
I have set PYTHONPATH, as
 
PYTHONPATH="/usr/local/bin/:/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:/Users/Shared/weewx/bin/:/Library/Frameworks/Python.framework/Versions/2.7/bin"

I've also not set it at all (commented out the set and export statement in .bash_profile) and tried to run weewx with the same result as originally posted: "ImportError: No module named configobj"

Thom Rogers

unread,
Feb 17, 2017, 6:57:02 PM2/17/17
to weewx-development
Thanks Vince.  Here's what those commands proruce:

Thomas-Rogerss-Mac-mini:~ chop$ pip list --format=columns

Package    Version
---------- -------
Cheetah    2.4.4  
configobj  
5.0.6  
Markdown   2.6.8  
olefile    
0.44    
Pillow     4.0.0  
pip        
9.0.1  
pyephem    
3.7.6.0
pyserial  
3.2.1  
pysqlite  
2.8.3  
pyusb      
1.0.0  
setuptools
32.1.0  
six        
1.10.0  
weewx      
3.6.2  
wheel      
0.29.0  

Thomas-Rogerss-Mac-mini:~ chop$ /usr/local/bin/python --version
Python 2.7.13

Thomas-Rogerss-Mac-mini:~ chop$ echo "MAc version OS X El Capitan 10.11.6"
MAc version OS X El Capitan 10.11.6

Thomas-Rogerss-Mac-mini:~ chop$ brew list
gdbm libusb openssl readline

git libusb
-compat python sqlite

Vince Skahan

unread,
Feb 17, 2017, 7:45:15 PM2/17/17
to weewx-development
On Friday, February 17, 2017 at 3:57:02 PM UTC-8, Thom Rogers wrote:
Thanks Vince.  Here's what those commands produce:


And there is no /usr/bin/python on your computer ?

And if you run /usr/local/bin/python, get into the python shell, and import configobj it fails ?

Still think you have two pythons installed perhaps....I'm not so worried about PYTHONPATH, but I'm wondering if PATH is picking up the system python not the brew one.


Thom Rogers

unread,
Feb 17, 2017, 7:53:15 PM2/17/17
to weewx-development
Apparently I havr\e both (/usr/bin/python   and also /usr/local/bin/python 0 NEITHER ONE IMPORTS CONFIGOBJ

Thomas-Rogerss-Mac-mini:~ chop$ /usr/local/bin/python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 12:39:47)  
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import configobj
Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
ImportError: No module named configobj
>>> ^D

Thomas-Rogerss-Mac-mini:~ chop$ /usr/bin/python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)  
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import configobj
Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
ImportError: No module named configobj

Vince Skahan

unread,
Feb 17, 2017, 8:42:37 PM2/17/17
to weewx-development
On Friday, February 17, 2017 at 4:53:15 PM UTC-8, Thom Rogers wrote:
Apparently I havr\e both (/usr/bin/python   and also /usr/local/bin/python 0 NEITHER ONE IMPORTS CONFIGOBJ



On my macbook using the same os version, I have just /usr/bin/python.

I did "sudo pip install configobj" which worked, then it shows up in 'pip list --format=columns' and I 'can' import it ok.

Hope this helps.  Note, pip did complain about ownership a little and failed until I ran pip under sudo, but I don't know what the best practice is on a mac for doing these things so your mileage may vary. 

Thom Rogers

unread,
Feb 19, 2017, 1:18:10 AM2/19/17
to weewx-development
Thanks to all.   I thought it looked like I had competing versions of Python 2.7 installed.  Fortunately, this machine is dedcated to just tis project, sio I erased the disk and did a full install of 10.11.6 (Mac El Capitan), and then reinstralled weewx.

I got weewx working with the simulator as a driver, but after installing the wh23xx driver I'm getting errors.  So will close out this thread and open new one on driver errors.  Thanks again to all.


On Thursday, February 16, 2017 at 7:50:28 PM UTC-7, Thom Rogers wrote:

Ivan Schrooyen

unread,
Mar 17, 2020, 3:59:50 PM3/17/20
to weewx-development
I am currently experiencing exactly the same issue.
Is there another solution than erasing the disk? ;-)

Vince Skahan

unread,
Mar 17, 2020, 4:58:09 PM3/17/20
to weewx-development
On Tuesday, March 17, 2020 at 12:59:50 PM UTC-7, Ivan Schrooyen wrote:
I am currently experiencing exactly the same issue.
Is there another solution than erasing the disk? ;-)



This is an over THREE year old thread, so lets start over please.

Usual problem report questions apply.

What os are you on, installed how (package or setup.py), which version of weewx, which version of python ?
What does your console report ?  What do your logs report ?

Reply all
Reply to author
Forward
0 new messages