Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get this error in Julia: ArgumentError: hasproperty of NULL PyObject What is it and how to resolve it? #508

Open
aj002 opened this issue Nov 22, 2020 · 13 comments

Comments

@aj002
Copy link

aj002 commented Nov 22, 2020

ArgumentError: hasproperty of NULL PyObject

Stacktrace:
[1] pyhasproperty(::PyCall.PyObject, ::String) at C:\Users\Home.julia\packages\PyCall\BcTLp\src\PyCall.jl:359
[2] hasproperty at C:\Users\Home.julia\packages\PyCall\BcTLp\src\PyCall.jl:365 [inlined]
[3] ioff(; kws::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\Home.julia\packages\PyPlot\XHEG0\src\PyPlot.jl:174
[4] ioff() at C:\Users\Home.julia\packages\PyPlot\XHEG0\src\PyPlot.jl:174
[5] top-level scope at C:\Users\Home.julia\packages\Plots\vsE7b\src\backends.jl:510
[6] eval at .\boot.jl:331 [inlined]
[7] _initialize_backend(::Plots.PyPlotBackend) at C:\Users\Home.julia\packages\Plots\vsE7b\src\backends.jl:504
[8] backend at C:\Users\Home.julia\packages\Plots\vsE7b\src\backends.jl:174 [inlined]
[9] pyplot(; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\Home.julia\packages\Plots\vsE7b\src\backends.jl:31
[10] pyplot() at C:\Users\Home.julia\packages\Plots\vsE7b\src\backends.jl:31
[11] top-level scope at In[10]:2
[12] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1091

@isentropic
Copy link

Having the same problem recently, though I'm running manjaro

@isentropic
Copy link

but I narrowed it to

julia> using PyPlot
┌ Warning: No working GUI backend found for matplotlib
└ @ PyPlot ~/.julia/packages/PyPlot/XHEG0/src/init.jl:165
ERROR: InitError: PyError (PyImport_ImportModule) <class 'ValueError'>
ValueError('call stack is not deep enough')
  File "/usr/lib/python3.8/site-packages/shiboken2/files.dir/shibokensupport/__feature__.py", line 107, in _import
    importing_module = sys._getframe(1).f_globals.get("__name__", "__main__")

@isentropic
Copy link

Native python works of course, but also:

julia> plt = pyimport("matplotlib.pyplot")
PyObject <module 'matplotlib.pyplot' from '/home/zhanibek/.local/lib/python3.8/site-packages/matplotlib/pyplot.py'>

julia> plt.plot(1)
1-element Array{PyObject,1}:
 PyObject <matplotlib.lines.Line2D object at 0x7f268cba9370>

julia> plt.show()

works too.
I tried using sytem python and rebuilding both packages to no avail. This happened after a recent system update

@zhaoguangyuan123
Copy link

i also got his bug, seems pyplot is very hard to use. We cannot even find a solution for this bug.

@arghavanpartovifard
Copy link

i also got his bug, seems pyplot is very hard to use. We cannot even find a solution for this bug.

I am experiencing the same problem...

@gideonsimpson
Copy link

Same here

@bennib22
Copy link

Hi,
I also ran into this issue. In my case i called

scatter(...)
scatter!(...)

inside a loop.
adding the overwrite_figure=true argument to scatter(...) resolved it for me.

@czy20000902
Copy link

Same problem, did you solve it?

@stevengj
Copy link
Member

stevengj commented Jan 22, 2024

It generally means that PyPlot wasn't able to initialize properly — there was probably an error earlier that you ignored?

@tylercritchfield
Copy link

I've run into this several times when adding another package inadvertently updates my PyPlot version. Once I revert to a previous version for PyPlot that seems to work.

@Dawitsco
Copy link

Dawitsco commented Nov 7, 2024

I've run into this several times when adding another package inadvertently updates my PyPlot version. Once I revert to a previous version for PyPlot that seems to work.

what version do you often revert to

@tylercritchfield
Copy link

I've run into this several times when adding another package inadvertently updates my PyPlot version. Once I revert to a previous version for PyPlot that seems to work.

what version do you often revert to

Whatever version it was at before it updated and broke. I'm currently using 2.11.2.

@Dawitsco
Copy link

Dawitsco commented Nov 8, 2024

I've run into this several times when adding another package inadvertently updates my PyPlot version. Once I revert to a previous version for PyPlot that seems to work.

what version do you often revert to

Whatever version it was at before it updated and broke. I'm currently using 2.11.2.

thanks a lot it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants