-
I wanted to add a package to my project as an optional dependency, so I ran $ poetry add --optional nopdb
Using version ^0.2.0 for nopdb
Updating dependencies
Resolving dependencies... (39.9s)
Writing lock file
No dependencies to install or update
$ python
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nopdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'nopdb' Without $ poetry add nopdb
Using version ^0.2.0 for nopdb
Updating dependencies
Resolving dependencies... (40.0s)
Writing lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing nopdb (0.2.0)
$ python
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nopdb
>>> Is this the intended behavior? If yes, how do I actually choose to install the package? I'm using Poetry version 1.1.13. |
Beta Was this translation helpful? Give feedback.
Answered by
abn
Mar 30, 2022
Replies: 1 comment 5 replies
-
You will have to assign the optional dependency to an extra. Once you have done that you can install it using the poetry install --extras nopdb |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
abn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You will have to assign the optional dependency to an extra.
Once you have done that you can install it using the
--extras
flag.