Hey! I'm trying to run the python demo locally - a...
# help
m
Hey! I'm trying to run the python demo locally - and hitting issues during
./pw demo
-- specifically I get stuck in
pw
on
Copy code
env_builder.create(venv_dir)
the error comes from here
Copy code
/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
Copy code
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
Hi. Are there any error messages or log lines before it gets killed?
m
not that I've found so far
c
And, you're trying to run https://github.com/cerbos/python-cognito-cerbos, right?
m
but if the one you sent is better, I'm happy to try that!
c
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
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:
Copy code
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
Are you using Python installed from Homebrew?
m
pyenv
Copy code
pyenv versions 
* system (set by /Users/walk003/.pyenv/version)
  3.8.13
  3.10.0
c
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
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
Copy code
File "/Users/walk003/orchard/collab/mwalker/cerbos/demo-python/main.py", line 7, in <module>
    import emoji
ModuleNotFoundError: No module named 'emoji'
c
Do
pdm install
m
thereee are my dependencies 🙏
cool, it's working now!
c
Awesome!
m
Thanks so much!
c
You're welcome