Skip to content

error using development version of package #82

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

Closed
lmiq opened this issue Dec 9, 2021 · 3 comments
Closed

error using development version of package #82

lmiq opened this issue Dec 9, 2021 · 3 comments
Labels
bug Something isn't working priority Should be fixed or implemented soon

Comments

@lmiq
Copy link

lmiq commented Dec 9, 2021

I am getting this error when trying to use a development version of a package:

In [6]: jl.Pkg.develop("CellListMap")                                                                 
   Resolving package versions...
    Updating `~/.julia/environments/PythonCall/Project.toml`
  [69e1c6dd] + CellListMap v0.7.0-DEV `~/.julia/dev/CellListMap`
    Updating `~/.julia/environments/PythonCall/Manifest.toml`
  [a4c015fc] + ANSIColoredPrinters v0.0.1
  [69e1c6dd] + CellListMap v0.7.0-DEV `~/.julia/dev/CellListMap`
  [187b0558] + ConstructionBase v1.3.0
  [ffbed154] + DocStringExtensions v0.8.6
  [e30172f5] + Documenter v0.27.10
  [b5f81e59] + IOCapture v0.2.2
  [bac558e1] + OrderedCollections v1.4.1
  [d96e819e] + Parameters v0.12.3
  [92933f4c] + ProgressMeter v1.7.1
  [efcf1570] + Setfield v0.7.1
  [90137ffa] + StaticArrays v1.2.13
  [3a884ed6] + UnPack v1.0.2
  [8ba89e20] + Distributed
  [9fa8497b] + Future
  [2f01184e] + SparseArrays
  [10745b16] + Statistics

In [7]: jl.seval("using CellListMap")                                                                 
---------------------------------------------------------------------------
JuliaError                                Traceback (most recent call last)
<ipython-input-7-53a2dfd17fba> in <module>
----> 1 jl.seval("using CellListMap")

~/.local/lib/python3.8/site-packages/juliacall/__init__.py in seval(self, expr)

JuliaError: MethodError: no method matching rawhandle(::PythonCall.PyIO)
Closest candidates are:
  rawhandle(!Matched::Base.LibuvStream) at ~/programs/julia/julia-1.7.0/share/julia/base/stream.jl:285
  rawhandle(!Matched::Base.Filesystem.File) at ~/programs/julia/julia-1.7.0/share/julia/base/filesystem.jl:94
  rawhandle(!Matched::Base.DevNull) at ~/programs/julia/julia-1.7.0/share/julia/base/cmd.jl:163
  ...

There is no error if using one stable version from the repo:


In [8]: jl.Pkg.rm("CellListMap")                                                                      
    Updating `~/.julia/environments/PythonCall/Project.toml`
  [69e1c6dd] - CellListMap v0.7.0-DEV `~/.julia/dev/CellListMap`
    Updating `~/.julia/environments/PythonCall/Manifest.toml`
  [a4c015fc] - ANSIColoredPrinters v0.0.1
  [69e1c6dd] - CellListMap v0.7.0-DEV `~/.julia/dev/CellListMap`
  [187b0558] - ConstructionBase v1.3.0
  [ffbed154] - DocStringExtensions v0.8.6
  [e30172f5] - Documenter v0.27.10
  [b5f81e59] - IOCapture v0.2.2
  [bac558e1] - OrderedCollections v1.4.1
  [d96e819e] - Parameters v0.12.3
  [92933f4c] - ProgressMeter v1.7.1
  [efcf1570] - Setfield v0.7.1
  [90137ffa] - StaticArrays v1.2.13
  [3a884ed6] - UnPack v1.0.2
  [8ba89e20] - Distributed
  [9fa8497b] - Future
  [2f01184e] - SparseArrays
  [10745b16] - Statistics

In [9]: jl.Pkg.add("CellListMap")                                                                     
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `~/.julia/environments/PythonCall/Project.toml`
  [69e1c6dd] + CellListMap v0.6.7
    Updating `~/.julia/environments/PythonCall/Manifest.toml`
  [69e1c6dd] + CellListMap v0.6.7
  [187b0558] + ConstructionBase v1.3.0
  [ffbed154] + DocStringExtensions v0.8.6
  [bac558e1] + OrderedCollections v1.4.1
  [d96e819e] + Parameters v0.12.3
  [92933f4c] + ProgressMeter v1.7.1
  [efcf1570] + Setfield v0.7.1
  [90137ffa] + StaticArrays v1.2.13
  [3a884ed6] + UnPack v1.0.2
  [8ba89e20] + Distributed
  [9fa8497b] + Future
  [2f01184e] + SparseArrays
  [10745b16] + Statistics

In [10]: jl.seval("using CellListMap")                                                                

In [11]:       
@cjdoris
Copy link
Collaborator

cjdoris commented Dec 9, 2021

Curious bug! I can't reproduce it myself.

From the presence of PyIO in the error, I'm guessing you're using JuliaCall from IPython? If so, doing the following may work around the issue:

jl.PythonCall.CONFIG.auto_ipython_display = False

(By default if PythonCall detects you're in IPython, it changes Julia's Base.stdout to point to Python's sys.stdout so that Julia output appears in IPython, but this is a somewhat experimental feature.)

It seems a bit like a bug in Julia though - somewhere some code is assuming that Base.stdout is a certain kind of IO object. Can you please do the following to figure out where the error is (I haven't yet got Python to show the stacktrace of Julia exceptions)?

jl.seval('try; using CellListMap; catch e; (e, stacktrace(catch_backtrace())); end')

@cjdoris
Copy link
Collaborator

cjdoris commented Dec 9, 2021

Ok I know what the bug is. I need to remove this stdout override.

@cjdoris cjdoris added bug Something isn't working priority Should be fixed or implemented soon labels Dec 9, 2021
@cjdoris
Copy link
Collaborator

cjdoris commented Dec 10, 2021

Fixed on master.

@cjdoris cjdoris closed this as completed Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority Should be fixed or implemented soon
Projects
None yet
Development

No branches or pull requests

2 participants