不能在 Julia 中使用 FITSIO
Cannot use FITSIO in Julia
我刚开始使用 Julia 并安装了 FITSIO 包。加载时出现以下错误
julia> using FITSIO
[ Info: Precompiling FITSIO [525bcba6-941b-5504-bd06-fd0dc1a4d2eb]
ERROR: LoadError: syntax: extra token "ImageHDU" after end of expression
Stacktrace:
[1] include at .\boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at .\loading.jl:1038
[3] include(::Module, ::String) at .\sysimg.jl:29
[4] top-level scope at none:2
[5] eval at .\boot.jl:319 [inlined]
[6] eval(::Expr) at .\client.jl:389
[7] top-level scope at .\none:3
in expression starting at C:\Users\romain\.julia\packages\FITSIO\WueGk\src\FITSIO.jl:54
ERROR: Failed to precompile FITSIO [525bcba6-941b-5504-bd06-fd0dc1a4d2eb] to C:\Users\romain\.julia\compiled\v1.0\FITSIO\mbga9.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] macro expansion at .\logging.jl:313 [inlined]
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1184
[4] macro expansion at .\logging.jl:311 [inlined]
[5] _require(::Base.PkgId) at .\loading.jl:941
[6] require(::Base.PkgId) at .\loading.jl:852
[7] macro expansion at .\logging.jl:311 [inlined]
[8] require(::Module, ::Symbol) at .\loading.jl:834
我尝试删除并重新添加 FITSIO 包,但我总是遇到同样的错误。堆栈跟踪似乎转到 FITSIO.jl 的第 54 行所以这里是该文件从第 46 行到第 57 行的内容
import .Libcfitsio: libcfitsio,
fits_assert_ok,
fits_assert_isascii,
TYPE_FROM_BITPIX
# HDU Types
@compat abstract type HDU end
type ImageHDU <: HDU
fitsfile::FITSFile
ext::Int
end
你知道如何让这个包工作吗?
谢谢:)
看来 Julia 使用
自动获取了错误的包
add FITSIO
我通过强制下载 URL 来解决问题
add https://github.com/JuliaAstro/FITSIO.jl
以下是 FITSIO 开发者的回答:
The latest stable version of this package isn't compatible with Julia
1.0. This has been already fixed in the development version, but we haven't tagged a new version since then.
Remove FITSIO.jl with
pkg> rm FITSIO
pkg> update
pkg> add FITSIO
pkg> dev FITSIO
After the rm, make sure you don't have any FITSIO.jl leftover, then
you can reinstall and switch to the development version within the
package manager, without installing another package
我刚开始使用 Julia 并安装了 FITSIO 包。加载时出现以下错误
julia> using FITSIO
[ Info: Precompiling FITSIO [525bcba6-941b-5504-bd06-fd0dc1a4d2eb]
ERROR: LoadError: syntax: extra token "ImageHDU" after end of expression
Stacktrace:
[1] include at .\boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at .\loading.jl:1038
[3] include(::Module, ::String) at .\sysimg.jl:29
[4] top-level scope at none:2
[5] eval at .\boot.jl:319 [inlined]
[6] eval(::Expr) at .\client.jl:389
[7] top-level scope at .\none:3
in expression starting at C:\Users\romain\.julia\packages\FITSIO\WueGk\src\FITSIO.jl:54
ERROR: Failed to precompile FITSIO [525bcba6-941b-5504-bd06-fd0dc1a4d2eb] to C:\Users\romain\.julia\compiled\v1.0\FITSIO\mbga9.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] macro expansion at .\logging.jl:313 [inlined]
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1184
[4] macro expansion at .\logging.jl:311 [inlined]
[5] _require(::Base.PkgId) at .\loading.jl:941
[6] require(::Base.PkgId) at .\loading.jl:852
[7] macro expansion at .\logging.jl:311 [inlined]
[8] require(::Module, ::Symbol) at .\loading.jl:834
我尝试删除并重新添加 FITSIO 包,但我总是遇到同样的错误。堆栈跟踪似乎转到 FITSIO.jl 的第 54 行所以这里是该文件从第 46 行到第 57 行的内容
import .Libcfitsio: libcfitsio,
fits_assert_ok,
fits_assert_isascii,
TYPE_FROM_BITPIX
# HDU Types
@compat abstract type HDU end
type ImageHDU <: HDU
fitsfile::FITSFile
ext::Int
end
你知道如何让这个包工作吗? 谢谢:)
看来 Julia 使用
自动获取了错误的包add FITSIO
我通过强制下载 URL 来解决问题
add https://github.com/JuliaAstro/FITSIO.jl
以下是 FITSIO 开发者的回答:
The latest stable version of this package isn't compatible with Julia 1.0. This has been already fixed in the development version, but we haven't tagged a new version since then.
Remove FITSIO.jl with
pkg> rm FITSIO pkg> update pkg> add FITSIO pkg> dev FITSIO
After the rm, make sure you don't have any FITSIO.jl leftover, then you can reinstall and switch to the development version within the package manager, without installing another package