Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv init command got an error on windows #6393

Closed
joe-cho opened this issue Aug 22, 2024 · 6 comments · Fixed by #6815
Closed

uv init command got an error on windows #6393

joe-cho opened this issue Aug 22, 2024 · 6 comments · Fixed by #6815
Assignees
Labels
error messages Messaging when something goes wrong

Comments

@joe-cho
Copy link

joe-cho commented Aug 22, 2024

Symptom

Whenever running uv init my-project, I am getting the same error:

error: No `project` table found in: `C:\Users\joe`

Context

The command I invoked on windows terminal.

uv init my-project

The uv platform

Windows 10 home edition

The uv version

uv 0.3.1 (be17d132a 2024-08-21)
@zanieb zanieb added bug Something isn't working windows Specific to the Windows platform labels Aug 22, 2024
@zanieb
Copy link
Member

zanieb commented Aug 22, 2024

Weird! Thanks for the report. Is there a pyproject.toml in the working directory or any of the directories above it? e.g. at C:\Users\joe?

Does uv init --no-workspace work?

@joe-cho
Copy link
Author

joe-cho commented Aug 22, 2024

Weird! Thanks for the report. Is there a pyproject.toml in the working directory or any of the directories above it? e.g. at C:\Users\joe?

Does uv init --no-workspace work?

It indeed worked with an warning:

PS C:\Users\joe\Projects\others> uv init my-project --no-workspace
warning: Ignoring workspace discovery error due to `--no-workspace`: No `project` table found in: `C:\Users\joe`
Initialized project `my-project` at `C:\Users\joe\Projects\others\my-project`

The folder structure of newly-created my-project:

PS C:\Users\joe\Projects\others\my-project> tree /F
Folder PATH listing
Volume serial number is D62B-04B3
C:.
│   pyproject.toml
│   README.md
│
└───src
    └───my_project
            __init__.py

--no-workspace option is intended to use when no folder (workspace) exist. Any section about it in official doc?

@charliermarsh
Copy link
Member

I think this is working as intended. It sounds like you maybe had an invalid pyproject.toml at the top-level? So specifying --no-workspace tells us to ignore any pyproject.toml in the parent directories.

@zanieb
Copy link
Member

zanieb commented Aug 22, 2024

@charliermarsh sounds like this error message isn't great though — we should probably include pyproject.toml in the path and add a context to the error (like we do for the warning)

@zanieb zanieb added error messages Messaging when something goes wrong and removed bug Something isn't working windows Specific to the Windows platform labels Aug 22, 2024
@zanieb zanieb reopened this Aug 22, 2024
@zanieb zanieb self-assigned this Aug 22, 2024
@jonmatthis
Copy link

Similar error when trying to initialize a new project in Windows 11

C:\Users\jonma\github_repos\jonmatthis>uv init hello-world
error: No `project` table found in: `C:\Users\jonma`

C:\Users\jonma\github_repos\jonmatthis>uv init            
error: No `project` table found in: `C:\Users\jonma`

I worked through the rest of the installation instructions as listed in the docs.


Speaking supportively and constructively as a fellow FOSS developer - I'd prioritize a fix on this if I were y'all. I'm an experienced developer who followed all the instructions in your docs and I was met with a completely show-stopping error with no obvious route for a fix. Adding the --no-workspace flag fixes the issue, but I had to come to repo Issues to find that.

If I wasn't so excited about this project, that would have been enough for me to bounce away from this project and never look back. Generally when I see this kind of breaking bug in a project's intro tutorial, my brain immediately tags it as 'not ready for prime time'

Thanks for your work on this! I look forward to using this tool! gl;hf!❤️

@charliermarsh
Copy link
Member

Thanks, I can make some improvements here now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants