Getting the following error on trellis init. Any thoughts on how to solve this?
`Initializing project…
⠙ Creating virtualenvError: [Errno 2] No such file or directory: ‘/Users/joe/Sites/scout-branding/la-bikini/trellis/.trellis/virtualenv/bin/python3’
[✘] Error creating virtualenv`
It’s quite difficult to help without any sort of details about your environment or your project.
Are you able to reproduce this issue on a fresh Trellis installation? If yes, can you provide basic details about your env such as your operating system and the versions of software that’s required by Trellis?
This issue started when I tried to deploy a new build I have. Then, I removed/reinstalled my Homebrew Python/brew-pip installs but then realized that it’s running on the MAc OS installed version. Really think that something is incorrect with my Python install although not sure how to fix it…
I’m surprised what @joshf suggested didn’t work. If you re-install Python it probably could break existing virtualenv’s that were created before and the solution in that case is to re-create them. But that still depends on having Python 3 installed properly.
That error could happen if the virtualenv wasn’t created successfully. Can you run the following commands in a new terminal and reply with the output please?
Here is what I get running trellis init and I have verified that the file does indeed exist:
`Initializing project…
⠙ Creating virtualenvError: [Errno 2] No such file or directory: ‘/Users/joe/Sites/bridgeworth-new/trellis/.trellis/virtualenv/bin/python3’
[✘] Error creating virtualenv
exit status 1
Project initialization failed due to the error above.
trellis-cli tried to create a virtual environment but failed.
=> /usr/bin/python3 -m venv
Without virtualenv, a Python virtual environment cannot be created and the required dependencies (eg: Ansible) can’t be installed either.`
I tried that before on Josh’s recommendation with same result. Beginning to think it is something with my Python installation because my old projects running Trellis are all having the same issue.
The actual error you’re seeing is coming from here. When Go tries to run the command, it fails because it doesn’t exist. But what’s confusing is right before it uses the same Installed method which was used earlier. Yet apparently it’s returning a different value now and one that doesn’t even exist?
At this point the virtualenv is not created or activated, so that’s why I’m confused how the same method used to detect the python3 command could return two different values and one of them doesn’t event exist.
The only other thing I can think to check is your shell config. Are you using Bash or Zsh? Can you post any mentions of trellis-cli from them? Either ~/.bash_profile or ~/.zshrc (or another file depending on your setup).