Windows install issue - ImportError: No module named bw2data

71 views
Skip to first unread message

Jim Levis

unread,
May 16, 2014, 10:00:09 AM5/16/14
to brigh...@googlegroups.com
I'm really interested in trying out Brightway2 for LCA work, but I've had an installation issue that I'm unable to resolve. 

I'm running Windows 7, and I successfully ran 

pip install brightway2

When I rerun it, it just says all of the requirements are already satisfied.

But, when I run 

bw2-web.py

it says

ImportError: No module named bw2data

But there is a bw2data folder in my Canopy site-packages folder.

It's probably some novice Python package issue (I don't have a lot of experience with these types of intalls). But any advice you could give me would be really appreciated.

Best,
Jim

Jim Levis

unread,
May 16, 2014, 12:14:26 PM5/16/14
to brigh...@googlegroups.com
Additionally if I call pip freeze it shows bw2data==0.17 in the list. So I don't know why bw2-web.py can't find it.

Christopher Mutel

unread,
May 16, 2014, 12:37:39 PM5/16/14
to Jim Levis, brigh...@googlegroups.com
Jim-

Thanks for your question. Installation, especially on Windows, is definitely a pain point, and all the feedback I can get from Windows-people is appreciated.

I haven't heard about this problem from other people, but I will do my best.

It looks like there is a path problem. Somehow the Python interpreter that is called when you run bw2-web.py is not finding the canopy site-packages folder. If you know where the bw2-web.py script is, you could put the following lines at the very beginning of this file (right after the line that looks like "#!/usr/bin/env python"):

import sys
for line in sys.path:
    print line

This will at least tell you if the "bw2data" folder is available (the canopy site-packages folder should be listed)

You can also trying running bw2-web.py directly from the Python shell in the Canopy Editor with:

!bw2-web.py 

(This is because ipython allows shell commands prefixed with a "!". But this might not work on your machine.)

Do you have another python installation on your machine? This could also be causing a conflict.

I am currently at a conference, so have limited availability, but I will be back on Monday. If you still have problems maybe we can troubleshoot over a videochat.

Yours,
-Chris
--
############################
Chris Mutel
Ökologisches Systemdesign - Ecological Systems Design
Institut f.Umweltingenieurwissenschaften - Institute for Environmental Engineering
ETH Zürich
John-von-Neumann-Weg 9
HPZ E33
8093 Zürich

############################

Jim Levis

unread,
May 16, 2014, 1:19:02 PM5/16/14
to brigh...@googlegroups.com, Jim Levis
Chris,

Thanks for the reply.

I'm pretty sure the issue is multiple installations. If I add the code to bw2-web.py and run it. I get this:

C:\Users\Jim\AppData\Local\Enthought\Canopy\User\Scripts
C:\Python27\lib\site-packages\setuptools-3.5.1-py2.7.egg
C:\Windows\system32\python27.zip
C:\Python27\DLLs
C:\Python27\lib
C:\Python27\lib\plat-win
C:\Python27\lib\lib-tk
C:\Python27
C:\Python27\lib\site-packages

And the same error. But, if I just run

for line in sys.path:
    print line

in the Canopy editor I get this list: 

C:\Users\Jim\AppData\Local\Enthought\Canopy\User\lib\site-packages\setuptools-3.5.1-py2.7.egg
C:\Users\Jim\AppData\Local\Enthought\Canopy\User\Scripts\python27.zip
C:\Users\Jim\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\DLLs
C:\Users\Jim\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\lib
C:\Users\Jim\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\lib\plat-win
C:\Users\Jim\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\lib\lib-tk
C:\Users\Jim\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64
C:\Users\Jim\AppData\Local\Enthought\Canopy\User
C:\Users\Jim\AppData\Local\Enthought\Canopy\User\lib\site-packages
C:\Users\Jim\AppData\Local\Enthought\Canopy\User\lib\site-packages\PIL
C:\Users\Jim\AppData\Local\Enthought\Canopy\User\lib\site-packages\win32
C:\Users\Jim\AppData\Local\Enthought\Canopy\User\lib\site-packages\win32\lib
C:\Users\Jim\AppData\Local\Enthought\Canopy\User\lib\site-packages\Pythonwin
C:\Users\Jim\AppData\Local\Enthought\Canopy\App\appdata
C:\Users\Jim\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\lib\site-packages
C:\Users\Jim\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\lib\site-packages\IPython\extensions

Which is what I want. Should I uninstall Python2.7.6 and Canopy and then reinstall Canopy?

Best,
Jim
Reply all
Reply to author
Forward
0 new messages