https://cerbos.dev logo
Title
m

Maggie Walker

08/30/2022, 10:47 AM
Hey! I'm trying to run the python demo locally - and hitting issues during
./pw demo
-- specifically I get stuck in
pw
on
env_builder.create(venv_dir)
the error comes from here
/Users/walk003/orchard/collab/mwalker/cerbos/demo-python/.pyprojectx/pyprojectx/0.9.9-py3.8/bin/python3 -Im ensurepip --upgrade --default-pip
and I get
zsh: killed      -Im ensurepip --upgrade --default-pip
I'm working in a new M1 macbook, and I've heard there's funkiness with python/pip + M1 -- have you all encountered anything similar?
c

Charith (Cerbos)

08/30/2022, 10:55 AM
Hi. Are there any error messages or log lines before it gets killed?
m

Maggie Walker

08/30/2022, 10:56 AM
not that I've found so far
c

Charith (Cerbos)

08/30/2022, 10:59 AM
And, you're trying to run https://github.com/cerbos/python-cognito-cerbos, right?
m

Maggie Walker

08/30/2022, 10:59 AM
but if the one you sent is better, I'm happy to try that!
c

Charith (Cerbos)

08/30/2022, 11:01 AM
Ah no. That's OK. I forgot that demo-python used
pw
as well. Let me investigate a bit more and get back to you.
m

Maggie Walker

08/30/2022, 11:01 AM
Thanks!
in the meantime I'm going to try the ole "delete it all and start from scratch" just to be sure
upon re-trying, I'm getting a different error I had gotten previously:
Referenced from: '/Users/walk003/orchard/collab/mwalker/cerbos/demo-python/.pyprojectx/pyprojectx/0.9.9-py3.8/bin/python3'
  Reason: tried: '/Users/walk003/orchard/collab/mwalker/cerbos/demo-python/.pyprojectx/pyprojectx/0.9.9-py3.8/bin/../Python3' (no such file), '/usr/local/lib/Python3' (no such file), '/usr/lib/Python3' (no such file)
zsh: abort       -Im ensurepip --upgrade --default-pip
c

Charith (Cerbos)

08/30/2022, 11:07 AM
Are you using Python installed from Homebrew?
m

Maggie Walker

08/30/2022, 11:07 AM
pyenv
pyenv versions 
* system (set by /Users/walk003/.pyenv/version)
  3.8.13
  3.10.0
c

Charith (Cerbos)

08/30/2022, 11:10 AM
Ah, maybe the
pw
script is getting confused by that. It's mainly a wrapper for setting up an isolated Python environment. You already have one from Pyenv from the sound of it. Do you have the
pdm
build tool installed? If so, you can just do
pdm run python main.py
m

Maggie Walker

08/30/2022, 11:12 AM
I see I see. I don't have pdm at the moment, but not against trying it out
let me brew install pdm and see if
pdm run python main.py
works
File "/Users/walk003/orchard/collab/mwalker/cerbos/demo-python/main.py", line 7, in <module>
    import emoji
ModuleNotFoundError: No module named 'emoji'
c

Charith (Cerbos)

08/30/2022, 11:16 AM
Do
pdm install
m

Maggie Walker

08/30/2022, 11:16 AM
thereee are my dependencies 🙏
cool, it's working now!
c

Charith (Cerbos)

08/30/2022, 11:17 AM
Awesome!
m

Maggie Walker

08/30/2022, 11:18 AM
Thanks so much!
c

Charith (Cerbos)

08/30/2022, 11:18 AM
You're welcome