tbreloff/Qwt.jl

ImportError('No module named BasicPlot',)

Closed this issue · 10 comments

Installed pyQt etc. via synaptic, then Qwt.jl cloned from here, when using i get:

lobi@orange4:~/juliarepo$ ../julia04/julia 
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-rc1 (2015-09-09 16:07 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-linux-gnu

julia> using Qwt
WARNING: could not import Base.help into PyCall
ERROR: LoadError: PyError (:PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError('No module named BasicPlot',)

 in pyerr_check at /home/lobi/.julia/v0.4/PyCall/src/exception.jl:58
 [inlined code] from /home/lobi/.julia/v0.4/PyCall/src/exception.jl:91
 in pyimport at /home/lobi/.julia/v0.4/PyCall/src/PyCall.jl:337
 in include at ./boot.jl:260
 in include_from_node1 at ./loading.jl:271
 in require at ./loading.jl:210
while loading /home/lobi/.julia/v0.4/Qwt/src/Qwt.jl, in expression starting on line 376

julia> Pkg.status()
WARNING: unknown Clang commit c4d18994, metadata may be ahead of package cache
16 required packages:
 - BinDeps                       0.3.15
 - Clang                         0.0.5+             master
 - Colors                        0.5.3
 - Dates                         0.4.4
 - Gadfly                        0.3.16
 - GraphViz                      0.0.4              master
 - Graphs                        0.5.6
 - Gtk                           0.8.4+             master
 - GtkUtilities                  0.0.4
 - ImageView                     0.1.16+            master
 - Images                        0.4.46+            master
 - PyCall                        0.8.2
 - PyPlot                        2.0.1
 - Tk                            0.3.6+             master
 - Vega                          0.4.0
 - Winston                       0.11.12+           master
50 additional packages: - ArrayViews                    0.6.3
 - Cairo                         0.2.30+            master
 - Calculus                      0.1.10
 - Codecs                        0.1.4
 - ColorBrewer                   0.2.1
 - ColorTypes                    0.1.4
 - ColorVectorSpace              0.0.3
 - Compat                        0.7.0
 - Compose                       0.3.14+            image
 - Contour                       0.0.7
 - Cxx                           0.0.0-             master (unregistered)
 - DataArrays                    0.2.18
 - DataFrames                    0.6.9
 - DataStructures                0.3.12
 - Distances                     0.2.0
 - Distributions                 0.8.6
 - Docile                        0.5.18
 - DualNumbers                   0.1.3
 - FixedPointNumbers             0.0.10
 - GZip                          0.2.17
 - Glob                          1.0.1
 - Graphics                      0.1.3
 - Grid                          0.3.10
 - Hexagons                      0.0.4
 - HttpCommon                    0.2.3
 - ImmutableArrays               0.0.10
 - IniFile                       0.2.4
 - Iplot                         0.0.0-             master (unregistered, dirty)
 - Iterators                     0.1.8
 - JSON                          0.4.5
 - KernelDensity                 0.1.1
 - LaTeXStrings                  0.1.4
 - Loess                         0.0.3
 - NaNMath                       0.1.0
 - Optim                         0.4.2
 - PDMats                        0.3.5
 - Qwt                           0.0.0-             master (unregistered)
 - Reexport                      0.0.3
 - Rsvg                          0.0.0-             master (unregistered, dirty)
 - SHA                           0.1.1
 - SIUnits                       0.0.5
 - Showoff                       0.0.4
 - SortingAlgorithms             0.0.5
 - StatsBase                     0.7.2
 - StatsFuns                     0.1.3
 - TexExtensions                 0.0.2
 - URIParser                     0.1.0
 - WoodburyMatrices              0.1.1
 - XCB                           0.0.0-             master (unregistered, dirty)
 - Zlib                          0.1.9

julia> versioninfo()
Julia Version 0.4.0-rc1
Commit e5c6964* (2015-09-09 16:07 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

You missed this step: Add the Qwt/src/python directory to your PYTHONPATH environment variable.

However, I should probably just add this to the julia environment variables programatically. I'll wait to close the issue until I do that.

I tend to disagree...

I'm on master, pulled from origin master, git status tells me i'm on master, git log tells me the last change is:

lobi@orange4:~/.julia/v0.4/Qwt$ git log | head
commit 1cbc7ff9461a631f68757cad39029d0786c48b35
Author: Thomas Breloff <tom@breloff.com>
Date:   Sun Sep 13 09:26:14 2015 -0400

    auto add src/python to PYTHONPATH, closes #6

and julia:

lobi@orange4:~/juliarepo$ ../julia04/julia 
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-rc1 (2015-09-09 16:07 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-linux-gnu

julia> using Qwt
WARNING: could not import Base.help into PyCall
ERROR: LoadError: PyError (:PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError('No module named BasicPlot',)

 in pyerr_check at /home/lobi/.julia/v0.4/PyCall/src/exception.jl:58
 [inlined code] from /home/lobi/.julia/v0.4/PyCall/src/exception.jl:91
 in pyimport at /home/lobi/.julia/v0.4/PyCall/src/PyCall.jl:337
 in include at ./boot.jl:260
 in include_from_node1 at ./loading.jl:271
 in require at ./loading.jl:210
while loading /home/lobi/.julia/v0.4/Qwt/src/Qwt.jl, in expression starting on line 376

It might be a path problem but your change doesn't help.

Ok. Maybe PyCall has its own copy of ENV? I'll have to check when I get home. Either way you can still set your PYTHONPATH yourself.

On Sep 13, 2015, at 10:58 AM, Andreas Lobinger notifications@github.com wrote:

I tend to disagree...

I'm on master, pulled from origin master, git status tells me i'm on master, git log tells me the last change is:

lobi@orange4:~/.julia/v0.4/Qwt$ git log | head
commit 1cbc7ff
Author: Thomas Breloff tom@breloff.com
Date: Sun Sep 13 09:26:14 2015 -0400

auto add src/python to PYTHONPATH, closes #6

and julia:lobi@orange4:~/juliarepo$ ../julia04/julia
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "?help" for help.
| | | | | | |/ ` | |
| | || | | | (| | | Version 0.4.0-rc1 (2015-09-09 16:07 UTC)
/ |'|||
'| |

|_/ | x86_64-linux-gnu

julia> using Qwt
WARNING: could not import Base.help into PyCall
ERROR: LoadError: PyError (:PyImport_ImportModule)
ImportError('No module named BasicPlot',)

in pyerr_check at /home/lobi/.julia/v0.4/PyCall/src/exception.jl:58
[inlined code] from /home/lobi/.julia/v0.4/PyCall/src/exception.jl:91
in pyimport at /home/lobi/.julia/v0.4/PyCall/src/PyCall.jl:337
in include at ./boot.jl:260
in include_from_node1 at ./loading.jl:271
in require at ./loading.jl:210
while loading /home/lobi/.julia/v0.4/Qwt/src/Qwt.jl, in expression starting on line 376


Reply to this email directly or view it on GitHub.

Reopening to investigate. I suspect this may be related to PyCall precompilation, but I need to look deeper.

Seems to work for me now without a PYTHONPATH set. I also tested with a clean cache and using PyCall before using Qwt, so I expect this should work in all cases. Can you try it out?

tom-mac-laptop:~ tom$ env |grep PYTHONPATH
tom-mac-laptop:~ tom$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-rc1+1 (2015-09-09 16:12 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 70ed392 (4 days old release-0.4)
|__/                   |  x86_64-apple-darwin13.4.0

julia> using Qwt
WARNING: could not import Base.help into PyCall

julia> plot(1:10)
Plot{lines=Qwt.PlotItem[Series{axis=left label=y_1 idx=1 npoints=10}]}

julia>
git pull origin
rm .julia/v0.4/lib/*.ji

lobi@orange4:~$ ./julia04/julia 
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-rc1 (2015-09-09 16:07 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-linux-gnu

julia> using PyCall
WARNING: could not import Base.help into PyCall
INFO: Precompiling module Compat...

julia> using Qwt
INFO: Precompiling module Colors...
ERROR: LoadError: PyError (:PyImport_ImportModule) <class 'locale.Error'>
Error('unsupported locale setting',)
  File "/home/lobi/.julia/v0.4/Qwt/src/python/pythonwidgets.py", line 1, in <module>
    from qwt_common import *
  File "/home/lobi/.julia/v0.4/Qwt/src/python/qwt_common.py", line 3, in <module>
    locale.setlocale(locale.LC_ALL, 'en_US')
  File "/usr/lib/python2.7/locale.py", line 579, in setlocale
    return _setlocale(category, locale)

 in pyerr_check at /home/lobi/.julia/v0.4/PyCall/src/exception.jl:58
 [inlined code] from /home/lobi/.julia/v0.4/PyCall/src/exception.jl:91
 in pyimport at /home/lobi/.julia/v0.4/PyCall/src/PyCall.jl:337
 in include at ./boot.jl:260
 in include_from_node1 at ./loading.jl:271
 in require at ./loading.jl:210
while loading /home/lobi/.julia/v0.4/Qwt/src/Qwt.jl, in expression starting on line 376

I pushed to master... please try again. Thanks for sticking with me... I clearly haven't had people use this from enough environments.

Works.

For platform specific notes, if you collect this:
I'm running an out-of-the-box Ubuntu14.04, installed python 2.7.6 and python-qwt5-qt4 with synaptic. My julia build is local.

I had some problems running other qt5 SW on my desktop as a use a non-compositing WM. The qt4 here seems fine.

One comment on qwt itself: After all the talk about plotting speed and interaction this looks a little bit disappointing; Non-antialiased line drawing (also the grids), panning only the current picture.

Thanks... glad you got it working.

As for your comments... I agree that it's not blazing fast... we did some tests a while ago and time-to-plot was similar in PyPlot and Qwt (of course the Plots.jl api will allow me to do some nice automated benchmark comparisons in the future). I also agree that if you want smooth, production-quality plots that something like Gadfly might be nicer.

I like Qwt because it's fast enough (usually), has most of the interaction I ever need (pan/zoom/toggle) and is pretty space efficient, with a legend that doesn't block the series, subplots with sliders between them, etc. If there's something specific that would make it better, it's possible I just don't have a feature turned on, so let me know (for example, I have a "fancy plot" sitting unused right now that has good handling of dates, linked axes between subplots, etc. If people start using Qwt as a Plots.jl backend, I may work on making that available.)

works as expected, closed.