import .sub as s
The_first_kcl_program = 'Hello World!'
b = s.sub
Compile main.k under bbb
$ cd bbb
$ kcl run main.k
error[E2F04]: CannotFindModule
--> /Users/ccc/bbb/main.k:1:1
|
1 | import .sub as s
| ^ Cannot find the module .sub from //bbb/sub
|
suggestion: try 'kcl mod add ' to download the missing package
suggestion: browse more packages at 'https://artifacthub.io'
error[E2G22]: TypeError
--> /Users/ccc/bbb/main.k:4:5
|
4 | b = s.sub
| ^ attribute 'sub' not found in 'module '..bbb.sub''
|
2. What did you expect to see? (Required)
The compile result
The_first_kcl_program: Hello World!
b: 1
3. What did you see instead (Required)
The error
error[E2F04]: CannotFindModule
--> /Users/ccc/bbb/main.k:1:1
|
1 | import .sub as s
| ^ Cannot find the module .sub from //bbb/sub
|
suggestion: try 'kcl mod add ' to download the missing package
suggestion: browse more packages at 'https://artifacthub.io'
error[E2G22]: TypeError
--> /Users/ccc/bbb/main.k:4:5
|
4 | b = s.sub
| ^ attribute 'sub' not found in 'module '..bbb.sub''
|
4. What is your KCL components version? (Required)
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
The use case:
The
sub.k
The
main.k
Compile
main.k
underbbb
2. What did you expect to see? (Required)
The compile result
3. What did you see instead (Required)
The error
4. What is your KCL components version? (Required)
The main branch of
kpm
,kcl
andkcl cli
.