Trellis-cli: Error installing dependencies on new project (cryptography package)

Hi everyone,

I’m new to Trellis and this style of development in general, so please excuse my ignorance. I’ve been developing Sage websites for a while now, and I’m enjoying it a lot. Recently, I’ve been trying to make development more efficient by automating deployment and while I was looking to use Trellis a while back, support for Apple Silicon didn’t seem that great, so I skipped it entirely.

Today I wanted to try again, since now there is the option of using Parallels.

I followed the instructions to install Trellis CLI but the initializing process seems to break at the virtualenv creation.

I am on macOS Monterey 12.0.1 on M1

My output: https://pastebin.com/raw/wrBwv4Vx

I’ve done everything the debug instructions say.

Can anyone point me in the right direction? I’ve tried using different versions of Python, installing/reinstalling cryptography etc.

1 Like

There’s a lot of output there, but the very last line says to run:

You should consider upgrading via the '/Users/myusername/Documents/Sites/mysite.com/trellis/.trellis/virtualenv/bin/python3 -m pip install --upgrade pip' command.

(or shorter: trellis exec python3 -m pip install --upgrade pip)

I’d try that first, then re-run trellis init and see if it works.

1 Like

I’ve spent hours on this and it was right there, thanks a lot. It worked.

1 Like

Awesome, glad that worked. I’ll add an automatic pip upgrade to trellis-cli soon too which would have taken care of this problem

Like I mentioned earlier, I’m quite inexperienced with Trellis or Python altogether. I didn’t really understand that Trellis uses its own version of Python, hence why all the updates I did on my machine installed Python weren’t doing anything.

I just kept removing the entire project folder and starting from scratch, but obviously that wasn’t going to do anything.

Feeling a little dumb at the moment, but I’m glad it’s sorted out. :slightly_smiling_face:

Great to hear this is getting automated. I’m sure it’ll help beginners like myself.

To clarify, Trellis doesn’t use its own version of Python, it uses whatever python3 is on your own system (macOS default, installed from homebrew, pyenv, etc).

It uses your python3 to create a virtual environment which gives trellis-cli a nice isolated environment for dependencies. When python creates a venv, it also creates a new binary for python3 within it so it might look like it’s its own python, but it’s still coming from your system’s.

I just kept removing the entire project folder and starting from scratch, but obviously that wasn’t going to do anything.

But yeah this is correct for the bug you ran into unfortunately which is why I’ll fix it within trellis-cli

1 Like

I have a lot to learn, thanks for clarifying.

This topic was automatically closed after 42 days. New replies are no longer allowed.