djangowindowspython-venvpython-poetryoserror

Django OSError: [Errno 22] Invalid argument in \\.venv\\Lib\\site-packages\\admin_tools


I have cloned a Django project from Gitlab repository and I get this error when I try to run the server.

OSError: [Errno 22] Invalid argument: 'C:\\Users\\irina\\project\\.venv\\Lib\\site-packages\\admin_tools\\theming\\templates\\admin:admin\\base.html'

Dependencies are installed via poetry.

I think the error is due to the encoding. How can this be fixed? I'm working on Windows 11.


Solution

  • the path you are trying to use does not look like windows path due tot he colons being in it.

    If you are using vscode right click on the base.html and select copy path. Then replace that path with the path you have copied. This will stop the error.

    C:/Users/irina/project/.venv/Lib/site-packages/admin_tools/theming/templates/admin/base.html

    Hope this helps