-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ModuleNotFoundError immediately after initializing a project #7622
Comments
👍 I got this problem often as well |
If you want the template project to be created with an importable directory like that you, consider using |
But I do initialize it with the |
Oh sorry -- I missed that. I can't reproduce this though. |
Yes, I can't reproduce this everywhere in my own computer either. Only when I'm under |
I'm experiencing the same issue on windows, a different folder with an existing project migrated from pdm. It looks like the local package was not installed under some condition before running the command. I also tried do it manually by running But when I deleted |
I tried to change from poetry to uv. Formally, with However, I used |
The following error occurs when I initialize a project under
~/Documents
but not say under~/Downloads
(in macos).Initialize a new project using
uv
:I initialized a new project named
trials
using theuv
command.Output:
Navigate to the project directory:
I changed the directory to the newly created
trials
project.cd trials
Run Python command to import the
trials
module:I attempted to run a Python command to import the
trials
module usinguv
.uv run python -c "import trials"
Output:
Using Python 3.10.15 Creating virtual environment at: .venv Built trials @ file:///Users/nisch/Documents/trials Installed 1 package in 1ms
Run the same command again:
I ran the same command again to import the
trials
module.uv run python -c "import trials"
Output:
Issue
After initializing the project and running the command to import the
trials
module, I encountered aModuleNotFoundError
. It seems that thetrials
module is not being recognized, even though the project was initialized successfully.Expected Behavior
The
trials
module should be importable after initializing the project and running the command.Actual Behavior
The
trials
module is not found, resulting in aModuleNotFoundError
.Verbose Output
I ran the command with the
-v
(verbose) flag to get more detailed output:uv run -v python -c "import trials"
Verbose Output:
Thanks in advance!
The text was updated successfully, but these errors were encountered: