[BUG] Unable to run Python version of cdk8s
See original GitHub issueDescribe the bug
Created new cdk8s python project and ran cdk8s synth
got following error.
Error: the command ./main.py could not be found within PATH or Pipfile's [scripts].
Error: non-zero exit code 1
at ChildProcess.<anonymous> (/usr/local/Cellar/cdk8s/0.21.0/libexec/lib/node_modules/cdk8s-cli/lib/util.js:18:27)
at Object.onceWrapper (events.js:418:26)
at ChildProcess.emit (events.js:311:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Also tried running hello-python example getting following error:
Traceback (most recent call last):
File "./main.py", line 2, in <module>
from constructs import Construct
ModuleNotFoundError: No module named 'constructs'
Error: non-zero exit code 1
at ChildProcess.<anonymous> (/usr/local/Cellar/cdk8s/0.21.0/libexec/lib/node_modules/cdk8s-cli/lib/util.js:18:27)
at Object.onceWrapper (events.js:418:26)
at ChildProcess.emit (events.js:311:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
To Reproduce
- Initialized app using
cdk8s init python-app
pipenv install
followed bycdk8s import --language python
then rancdk8s synth
For hello-python followed instructions from README which is same as step 2
Expected behavior To get manifest files in dist folder
Additional context Operating System: macOS Mojave Python version: 3.8 and 3.7 Pipenv version: 2018.11.26 cdk8s Installation method: Homebrew Shell: Tried with Bash, Zsh, Fish
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
[BUG] Unable to run Python version of cdk8s · Issue #170
Describe the bug Created new cdk8s python project and ran cdk8s synth got following error. Error: the command ./main.py could not be found ......
Read more >Python - cdk8s
If any init container fails, the pod is considered to have failed and is ... will only count 3 missed schedules, and thus...
Read more >Announcing Java support for cdk8s | Containers - Amazon AWS
In this tutorial, we'll learn how to use Java cdk8s to define a simple deployment of a load balancer service that will front...
Read more >Integrating cdk8s with Argo CD - Max Brenner
I'm going to use Python but feel free to go with TypeScript. ... Unable to generate manifests in cdk8s-guestbook: rpc error: code =...
Read more >Write your Kubernetes Infrastructure in Go with cdk8s - Vultr.com
cdk8s lets you import objects from any Kubernetes API version and also custom resource definitions for use. cdk8s allows you to define abstract ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@eladb Sorry, but it does not seem to work. I just installed 0.24.0 and when I issue cdk8s, a command not found is returned. If I run the sample code, it does not work as well:
python file.py, returns:
For anyone who may be running into this. I resolved due to a hint I picked up in the CDK documentation that pointed to cdk.json as an area that may need to be updated: https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-python.html
cdk8s doesn’t have this config file, AFAIK, but I changed the Python interpreter command in in the cdk8s-generated main.py to python3 instead of python due to way that Python 3.7 is installed on my Mac.
Now my Mac is correctly-generating Python-based cdk8s manifests. I hope that helps someone else.