Yes I have read and set my project as described in the starter guide for Windows + wsl users but I ended up with an SSH error (timeout).
I’ve just noticed that I’m getting an error from WSL too with the trellis new mytest.test
Creating virtualenv in /mnt/d/Projects/mytest.test/trellis/.trellis/virtualenv
Error creating virtualenv: exit status 1
ERROR! Unexpected Exception, this is probably a bug: cannot import name 'CollectionRequirement' from 'ansible.galaxy.collection' (/home/phxitm/.local/lib/python3.8/site-packages/ansible/galaxy/collection/__init__.py)
Error running ansible-galaxy: exit status 250
mytest.test project created with versions:
There’s 3 errors in your output which makes it confusing, but it’s the first error causing the other two. trellis-cli creates a Python virtual environment where it installs dependencies (like Ansible). Since the virtualenv failed to create, dependencies couldn’t be installed either which just leads to more errors.
I just published v1.4.0 which should help in two ways:
it provides much better error messages in cases like this, which should help debug at least
it will fail earlier during trellis new so it’s much more obvious
If you could upgrade and run trellis new mytest.test again, hopefully we can figure out what’s going wrong.
I’ve just installed the v1.4.0 and this is the error output I’m getting :
Creating new Trellis project in /mnt/d/Projects/mytest.test
Site domain [mytest.test]:
[✘] 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 a Python virtual environment the required dependencies (eg: Ansible) can't be installed.
There are two options:
1. Ensure Python 3 is installed and the `python3` command works. trellis-cli will use python3's built-in venv feature.
2. Disable trellis-cli's virtual env feature by setting this env variable: export TRELLIS_VENV=false
This could also be a bug in trellis-cli. Please create an issue at https://github.com/roots/trellis-cli and include the output above.
The issue was indeed related to the virtual environment not being created :
/usr/bin/python3 -m venv .trellis/virtualenv
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt install python3.8-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: ['/mnt/d/Projects/mytest.test/.trellis/virtualenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']
I ran a sudo apt install python3.8-venv to install the missing package and started all over again.
Now the trellis new mytest.test is working fine! Problem solved. Thank you!