python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31k stars 2.25k forks source link

Add editable not working on Win11 Python3.11 #7643

Open codeheart09 opened 1 year ago

codeheart09 commented 1 year ago

Issue

I have two local packages, pack-1 and pack-2. When I add the pack-1 to the pack-2 (poetry add --editable ../pack-1) the pack-1 is added to the pyproject.toml of the pack-2, but when I import the module pack_1 (in any of the pack-2 files) I have the error No module named 'pack_1'.

pack-1 pyproject.toml:

[tool.poetry]
name = "pack-1"
version = "0.1.0"
description = ""
authors = [""]
readme = "README.md"
packages = [{include = "pack_1"}]

[tool.poetry.dependencies]
python = "^3.11"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

pack-2 pyproject.toml:

[tool.poetry]
name = "pack-2"
version = "0.1.0"
description = ""
authors = [""]
readme = "README.md"
packages = [{include = "pack_2"}]

[tool.poetry.dependencies]
python = "^3.11"
pack-1 = {path = "../pack-1", develop = true}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

In MacOS the expected behavior (the module being available to pack-2) is successful. I've been only experiencing this on Windows 11.

Let me know if you need any more info.

codeheart09 commented 1 year ago

Log output for the add command with -vvv:

...
   1: derived: oack-1 (0.1.0) @ file:///C:/Users/Usu%C3%A1rio/............./pack-1
...
• Installing oack-1 (0.1.0 C:/Users/Usuário/............./pack-1)
dimbleby commented 1 year ago

sounds duplicate #7574, please close

codeheart09 commented 1 year ago

@dimbleby , don't seem to be duplicate. I installed poetry via (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py - --git https://github.com/python-poetry/poetry.git@1.4 and also master but the issue persists - from what I get the #7574 is already merged, right?

dimbleby commented 1 year ago

fair enough

I don't use poetry on windows so can't offer further help. The only other idea that suggests itself looking at your log is that maybe the non-ascii username in the path might have confused something along the way, but it is only a guess.

codeheart09 commented 1 year ago

@dimbleby Yes, I passed both python and poetry to C:\Program Files (and the project to outside the user dir) and everything worked as expected. Having it under utf-8/accentuated characters makes the issue happen.