vtsuperdarn / davitpy

DEPRECATED The DaViT Python project
http://vtsuperdarn.github.com/davitpy/
GNU General Public License v3.0
37 stars 58 forks source link

OpenSUSE 12.1 davitpy install - autoreload and basemap (again) #7

Closed mrwessel closed 11 years ago

mrwessel commented 11 years ago

I have got my davitpy install to the point where I can run it with the > davitpy command in my regular user account, but once python loads I get problems with autoreload and basemap:

[TerminalIPythonApp] Running code in user namespace: %load_ext autoreload
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/home/matt/davitpy/<ipython-input-1-c5fcb8db5aad> in <module>()
----> 1 get_ipython().magic(u"load_ext autoreload")

/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s, next_input)
   1892                 self._magic_locals = sys._getframe(1).f_locals
   1893             with self.builtin_trap:
-> 1894                 result = fn(magic_args)
   1895             # Ensure we're not keeping object references around:

   1896             self._magic_locals = {}

/usr/lib/python2.7/site-packages/IPython/core/magic.pyc in magic_load_ext(self, module_str)
   3341     def magic_load_ext(self, module_str):
   3342         """Load an IPython extension by its module name."""
-> 3343         return self.extension_manager.load_extension(module_str)
   3344 
   3345     def magic_unload_ext(self, module_str):

/usr/lib/python2.7/site-packages/IPython/core/extensions.pyc in load_extension(self, module_str)
     85         if module_str not in sys.modules:
     86             with prepended_to_syspath(self.ipython_extension_dir):
---> 87                 __import__(module_str)
     88         mod = sys.modules[module_str]
     89         return self._call_load_ipython_extension(mod)

ImportError: No module named autoreload
[TerminalIPythonApp] Running code in user namespace: %autoreload 2
ERROR: Magic function `autoreload` not found.
[TerminalIPythonApp] Running code in user namespace: import pydarn
problem importing radar:  'DBREADUSER'
utils/__init__.py -> utils.plotUtils:  cannot import name basemap
problem importing dbUtils:  'DBREADUSER'
problem importing fan:  No module named basemap

followed by the python command prompt.

From what I read, autoreload is supposed to be bundled with iPython, but somehow it is missing in my case. As for basemap, we've already been through this, and now there are more troubles!

sdelarquier commented 11 years ago

Could you provide the output of pip freeze so that we can see the versions of your python packages.

mrwessel commented 11 years ago
matt@phys30811:~> pip freeze
Beaker==1.5.4
BeautifulSoup==3.0.8.1
Brlapi==0.5.5
Coherence==0.6.6.2
Louie==1.1
Mako==0.4.2
MarkupSafe==0.15
PIL==1.1.7
PyOpenGL==3.0.1
PyPAM==0.5.0
Pygments==1.6
Twisted==11.0.0
basemap==1.0.6
ccsm==0.9.5.94
compizconfig-python==0.9.5.94
cupshelpers==1.0
distribute==0.6.21
gdata==2.0.14
gmixer==1.0
httplib2==0.7.1
ipython==0.13.2
louis==2.3.0
lxml==2.3
matplotlib==1.2.1
numpy==1.7.1
papyon==0.5.6
paramiko==1.7.7.1
pyOpenSSL==0.12
pycrypto==2.3
pycups==1.9.59
pycurl==7.19.0
pymongo==2.5.2
pyserial==2.5
pysmbc==1.0.11
python-dateutil==1.5
python-xlib==0.12
pytz==2012c
pyudev==0.12
pyxdg==0.19
pyzmq==2.1.7
scipy==0.12.0
simple-ccsm==0.9.2.1
simplejson==2.2.1
synaptiks==0.8.0
tornado==2.3
urlgrabber==3.9.1
wsgiref==0.1.2
zope.interface==3.8.0
sdelarquier commented 11 years ago

Thanks! It looks like you have the same versions I am running in my virtual OpenSuSe 12.1... It also seems you have some problem with environment variables. This may sounds more like a problem specific to your own system.

You can check a few things:

Let me know what you find.

On Tue, Jun 18, 2013 at 3:18 PM, mrwessel notifications@github.com wrote:

matt@phys30811:~> pip freezeBeaker==1.5.4BeautifulSoup==3.0.8.1Brlapi==0.5.5Coherence==0.6.6.2Louie==1.1Mako==0.4.2MarkupSafe==0.15PIL==1.1.7PyOpenGL==3.0.1PyPAM==0.5.0Pygments==1.6Twisted==11.0.0basemap==1.0.6ccsm==0.9.5.94 compizconfig-python==0.9.5.94cupshelpers==1.0distribute==0.6.21gdata==2.0.14gmixer==1.0httplib2==0.7.1ipython==0.13.2louis==2.3.0lxml==2.3matplotlib==1.2.1numpy==1.7.1papyon==0.5.6paramiko==1.7.7.1pyOpenSSL==0.12pycrypto==2.3pycups==1.9.59pycurl==7.19.0pymongo==2.5.2pyserial==2.5pysmbc==1.0.11 python-dateutil==1.5 python-xlib==0.12pytz==2012cpyudev==0.12pyxdg==0.19pyzmq==2.1.7scipy==0.12.0 simple-ccsm==0.9.2.1simplejson==2.2.1synaptiks==0.8.0tornado==2.3urlgrabber==3.9.1wsgiref==0.1.2 zope.interface==3.8.0

— Reply to this email directly or view it on GitHubhttps://github.com/vtsuperdarn/davitpy/issues/7#issuecomment-19634259 .

mrwessel commented 11 years ago

I had to add a line to my bashrc to set DAVITPY, and another to source $DAVITPY/profile.bash. Now that I have done that, echo $DBREADUSER returns sd_dbread. ipython is version 0.11, python is 2.7.2. I was able to find autoreload in /usr/local/lib/python2.7/site-packages/IPython/extensions. If I run davitpy while in the site-packages directory it loads autoreload correctly, but if I run it while in the davitpy directory it will not. There is a basemap-1.0.6-py2.7.egg-info file in site-packages, but aside from that there is only a mention in the comments of an __init__.py file and _geoslib.so, which grep thinks matches despite being a binary. The find command returns nothing.

sdelarquier commented 11 years ago

Okay, so I can see one first problem: your ipython (the one davitpy calls when you run it) is the old version. Try typing which ipython and go rename the file it points to as ipython.old for instance. Then, try running which ipython again, and you should see a different file. Now, if you type ipython --version you should see 0.13.2. That should at least fix your autoreload problem.

Now for basemap. Do you mean to say you can do import mpl_toolkits.basemap-1.0.6? Or is there just a basemap-1.0.6 directory where I suggested to look?

On Tue, Jun 18, 2013 at 4:56 PM, mrwessel notifications@github.com wrote:

There is a `basemap-1.0.6

— Reply to this email directly or view it on GitHubhttps://github.com/vtsuperdarn/davitpy/issues/7#issuecomment-19641484 .

mrwessel commented 11 years ago

It turns out the old ipython binary was the only one on the machine. I tried to upgrade with pip, but this is what I got:

matt@phys30811:~> sudo pip install --upgrade ipython
Downloading/unpacking ipython
  Downloading ipython-0.13.2.zip (6.4Mb): 6.4Mb downloaded
  Running setup.py egg_info for package ipython

Installing collected packages: ipython
  Found existing installation: ipython 0.13.2
    Uninstalling ipython:
      Successfully uninstalled ipython
  Running setup.py install for ipython

    Installing ipcontroller script to /usr/local/bin
    Installing iptest script to /usr/local/bin
    Installing ipcluster script to /usr/local/bin
    Installing ipython script to /usr/local/bin
    Installing pycolor script to /usr/local/bin
    Installing iplogger script to /usr/local/bin
    Installing irunner script to /usr/local/bin
    Installing ipengine script to /usr/local/bin
Successfully installed ipython
Cleaning up...
matt@phys30811:~> ipython --version
0.11

So it gets the file named 0.13.2 but it actually contains 0.11? And where it says it found an existing 0.13.2, that was just the same 0.11 as before.

I think there is no actual basemap there. These are the contents of mpl_toolkits:

matt@phys30811:/usr/local/lib/python2.7/site-packages/mpl_toolkits> ls
axes_grid   axisartist     exceltools.pyc  gtktools.pyc  __init__.pyc
axes_grid1  exceltools.py  gtktools.py     __init__.py   mplot3d

The only thing called basemap is the egg-info file a directory up from there.

sdelarquier commented 11 years ago

Matt, what do you get when you type which ipython? If you get /usr/local/bin it should be the 0.13.2 version.

As for basemap, maybe something did not work properly during the installation. Did you run the install script with sudo? Could you try these lines and send me the content of install_log:

cd /tmp
clone https://github.com/matplotlib/basemap.git
cd basemap
sudo python setup.py install > install_log

Thanks.

On Tue, Jun 18, 2013 at 6:38 PM, mrwessel notifications@github.com wrote:

It turns out the old ipython binary was the only one on the machine. I tried to upgrade with pip, but this is what I got:

matt@phys30811:~> sudo pip install --upgrade ipython Downloading/unpacking ipython Downloading ipython-0.13.2.zip (6.4Mb): 6.4Mb downloaded Running setup.py egg_info for package ipython

Installing collected packages: ipython Found existing installation: ipython 0.13.2 Uninstalling ipython: Successfully uninstalled ipython Running setup.py install for ipython

Installing ipcontroller script to /usr/local/bin
Installing iptest script to /usr/local/bin
Installing ipcluster script to /usr/local/bin
Installing ipython script to /usr/local/bin
Installing pycolor script to /usr/local/bin
Installing iplogger script to /usr/local/bin
Installing irunner script to /usr/local/bin
Installing ipengine script to /usr/local/bin

Successfully installed ipython Cleaning up... matt@phys30811:~> ipython --version 0.11

So it gets the file named 0.13.2 but it actually contains 0.11? And where it says it found an existing 0.13.2, that was just the same 0.11 as before.

I think there is no actual basemap there. These are the contents of mpl_toolkits:

matt@phys30811:/usr/local/lib/python2.7/site-packages/mpl_toolkits> ls axes_grid axisartist exceltools.pyc gtktools.pyc init.pyc axes_grid1 exceltools.py gtktools.py init.py mplot3d

The only thing called basemap is the egg-info file a directory up from there.

— Reply to this email directly or view it on GitHubhttps://github.com/vtsuperdarn/davitpy/issues/7#issuecomment-19648186 .

mrwessel commented 11 years ago

Yes, I get /usr/local/bin/ipython, but ipython --version still returns 0.11 and autoreload still does not work.

Install script was run with sudo.

I deleted the existing /tmp/basemap and reinstalled; here are the contents of the log file. Davitpy now appears to load basemap correctly.

sdelarquier commented 11 years ago

Good news for basemap. I do not know why it was not installed properly to begin with, but at least it works. As for ipython, I am starting to run out of ideas. Try uninstalling it with zypper sudo zypper remove ipython and then install it again with pip sudo pip install ipython. If that does not work, I don't know what will...

mrwessel commented 11 years ago

Success! I did the zypper uninstall, but the binary stayed put in /usr/local/bin, so I had to remove that. On top of that I had to get rid of the separate install I did yesterday with pip (doing --upgrade), which thought it was 13 when it was actually 11(?????). When all was clear I did a full pip install, and now it works.

Thanks for all the help!