JuliaPy / JuliaPy/PythonCall.jl

AttributeError: 'NoneType' object has no attribute 'f_locals'

Offen
#490 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Julia
Sterne
1.1k
Forks
86
Ø Merge
1 T. 22 Std.
Gemergte PRs (30 T.)
3

Beschreibung

**Affects:** PythonCall

**Describe the bug**
Minimal working example:

```julia
using PythonCall

sym = pyimport("sympy")

a = sym.Symbol("a", positive=true)
sym.lambdify(a, a)
```

```julia
Python: AttributeError: 'NoneType' object has no attribute 'f_locals'

Stacktrace:
[1] pythrow()
@ PythonCall.Core [~/.julia/packages/PythonCall/bb3ax/src/Core/err.jl:92](https://file+.vscode-resource.vscode-cdn.net/home/alberto/GitHub/PhD-Thesis-Notebooks/~/.julia/packages/PythonCall/bb3ax/src/Core/err.jl:92)
[2] errcheck
@ [~/.julia/packages/PythonCall/bb3ax/src/Core/err.jl:10](https://file+.vscode-resource.vscode-cdn.net/home/alberto/GitHub/PhD-Thesis-Notebooks/~/.julia/packages/PythonCall/bb3ax/src/Core/err.jl:10) [inlined]
[3] pycallargs(f::Py, args::Py)
@ PythonCall.Core [~/.julia/packages/PythonCall/bb3ax/src/Core/builtins.jl:212](https://file+.vscode-resource.vscode-cdn.net/home/alberto/GitHub/PhD-Thesis-Notebooks/~/.julia/packages/PythonCall/bb3ax/src/Core/builtins.jl:212)
[4] pycall(::Py, ::Py, ::Vararg{Py}; kwargs::@Kwargs{})
@ PythonCall.Core [~/.julia/packages/PythonCall/bb3ax/src/Core/builtins.jl:230](https://file+.vscode-resource.vscode-cdn.net/home/alberto/GitHub/PhD-Thesis-Notebooks/~/.julia/packages/PythonCall/bb3ax/src/Core/builtins.jl:230)
[5] pycall(::Py, ::Py, ::Vararg{Py})
@ PythonCall.Core [~/.julia/packages/PythonCall/bb3ax/src/Core/builtins.jl:220](https://file+.vscode-resource.vscode-cdn.net/home/alberto/GitHub/PhD-Thesis-Notebooks/~/.julia/packages/PythonCall/bb3ax/src/Core/builtins.jl:220)
[6] (::Py)(::Py, ::Vararg{Py}; kwargs::@Kwargs{})
@ PythonCall.Core [~/.julia/packages/PythonCall/bb3ax/src/Core/Py.jl:339](https://file+.vscode-resource.vscode-cdn.net/home/alberto/GitHub/PhD-Thesis-Notebooks/~/.julia/packages/PythonCall/bb3ax/src/Core/Py.jl:339)
[7] top-level scope
@ In[8]:5
```

**Your system**

```julia
Status `~/GitHub/PhD-Thesis-Notebooks/Project.toml`
[992eb4ea] CondaPkg v0.2.22
[429524aa] Optim v1.9.4
[6099a3de] PythonCall v0.9.19
[6c2fb7c5] QuantumToolbox v0.7.2
[a25cea48] SpecialPolynomials v0.4.9
```

```julia
julia> versioninfo()
Julia Version 1.10.2
Commit bd47eca2c8a (2024-03-01 10:14 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 32 × 13th Gen Intel(R) Core(TM) i9-13900KF
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, goldmont)
Threads: 32 default, 0 interactive, 16 GC (on 32 virtual cores)
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS = 32
```

```julia
CondaPkg Status /home/alberto/GitHub/PhD-Thesis-Notebooks/CondaPkg.toml
Environment
/home/alberto/GitHub/PhD-Thesis-Notebooks/.CondaPkg/env
Packages
numpy v1.26.4
sympy v1.12
```

**Additional context**
Add any other context about the problem here.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.