简体   繁体   English

julia UndefVarError:取消转换! 没有定义的

[英]julia UndefVarError: unshift! not defined

I use julia 1.4, and running the following code:我使用 julia 1.4,并运行以下代码:

using PyCall
using JLD
using ArgParse
using Pandas
@pyimport networkx as nx
@pyimport scipy.sparse.csgraph as csg
@pyimport numpy as np

unshift!(PyVector(pyimport("sys")["path"]), "")
# unshift!(PyVector(pyimport("sys")["path"]), "..")
unshift!(PyVector(pyimport("sys")["path"]), "combinatorial")
@pyimport utils.load_graph as lg
@pyimport utils.distortions as dis
@pyimport graph_util as gu
....

when I run this code, I get the following error:当我运行此代码时,出现以下错误:

 ERROR: LoadError: UndefVarError: unshift! not defined
Stacktrace:
 [1] top-level scope at /root/hyperbolics/combinatorial/comb.jl:9
 [2] include(::Module, ::String) at ./Base.jl:377
 [3] exec_options(::Base.JLOptions) at ./client.jl:288
 [4] _start() at ./client.jl:484
in expression starting at /root/hyperbolics/combinatorial/comb.jl:9

When I searched documents, unshift.当我搜索文档时,取消移动。 is existing function in julia 1,4.在 julia 1,4 中存在 function。 so I don't get why this error occurs, I'm new to julia. please help.所以我不明白为什么会出现此错误,我是 julia 的新手。请帮忙。

unshift.不动。 is existing function in julia 1.4在 julia 1.4 中存在 function

Where did you see this?你在哪里看到的? It was renamed for Julia 1.0 two years ago to pushfirst!两年前改名为Julia 1.0 pushfirst! : :

julia> pushfirst!([1, 2, 3], 4)
4-element Array{Int64,1}:
 4
 1
 2
 3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM