Closed attila-papai closed 1 year ago
I suspect the main problem is that Poetry natively installs dependencies into a virtual environment, and you haven't activated it. If I use poetry run python
to ensure the virtual environment is activated, I can't reproduce this on an M1 Macbook Pro:
❯ poetry init
This command will guide you through creating your pyproject.toml config.
Package name [foo]:
Version [0.1.0]:
Description []: an example project
Author [None, n to skip]: n
License []: AGPL
Compatible Python versions [^3.11]: >3.6
Would you like to define your main dependencies interactively? (yes/no) [yes] no
Would you like to define your development dependencies interactively? (yes/no) [yes] no
Generated file
[tool.poetry]
name = "foo"
version = "0.1.0"
description = "an example project"
authors = ["Your Name <you@example.com>"]
license = "AGPL"
readme = "README.md"
[tool.poetry.dependencies]
python = ">3.6"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Do you confirm generation? (yes/no) [yes] y
❯ poetry add cuid
Using version ^0.3 for cuid
Updating dependencies
Resolving dependencies... (6.6s)
Writing lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing cuid (0.3)
❯ poetry run python
Python 3.11.1 (main, Dec 23 2022, 09:28:24) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cuid
>>> cuid.cuid()
'clew2f85r00002jd9lx2lzedn'
Whereas if I don't activate a virtual environment, or anything...
❯ python3
Python 3.9.6 (default, Oct 18 2022, 12:41:40)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cuid
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cuid'
I'm closing it as I'm not able to reproduce this, but please reopen if you still have this issue!
Hey,
I have a MacBook Pro M1 and when I try to install
cuid
package withpoetry
and use it, I get an error that the module cannot be found.If I install it with
pip
it works, but my project usespoetry
so can't just install it withpip
: