question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poetry incorrectly resolves netmiko dependencies

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

It seems that poetry incorrectly resolves netmiko dependencies. Here is the output with poetry in Docker (Python 3.6.7):

/ # poetry add netmiko
Skipping virtualenv creation, as specified in config file.
Using version ^2.3 for netmiko

Updating dependencies
Resolving dependencies... (26.2s)


Package operations: 15 installs, 0 updates, 0 removals

Writing lock file

  - Installing pycparser (2.19)
  - Installing asn1crypto (0.24.0)
  - Installing cffi (1.11.5)
  - Installing bcrypt (3.1.6)
  - Installing cryptography (2.5)
  - Installing pyasn1 (0.4.5)
  - Installing pynacl (1.3.0)
  - Installing paramiko (2.4.2)
  - Installing enum34 (1.1.6)   # enum34 is installed when it is not supposed to
  - Installing ipaddress (1.0.22)
  - Installing pyserial (3.4)
  - Installing pyyaml (3.13)
  - Installing scp (0.13.0)
  - Installing textfsm (0.4.1)
  - Installing netmiko (2.3.0)

Here is the output from pip when installing netmiko (enum34 is not installed):

(.test-venv) / # pip install netmiko
Collecting netmiko
...
Successfully installed asn1crypto-0.24.0 bcrypt-3.1.6 cffi-1.11.5 cryptography-2.5 netmiko-2.3.0 paramiko-2.4.2 pyasn1-0.4.5 pycparser-2.19 pynacl-1.3.0 pyserial-3.4 pyyaml-3.13 scp-0.13.0 six-1.12.0 textfsm-0.4.1
You are using pip version 10.0.1, however version 19.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(.test-venv) / # pip freeze
asn1crypto==0.24.0
bcrypt==3.1.6
cffi==1.11.5
cryptography==2.5
netmiko==2.3.0
paramiko==2.4.2
pyasn1==0.4.5
pycparser==2.19
PyNaCl==1.3.0
pyserial==3.4
PyYAML==3.13
scp==0.13.0
six==1.12.0
textfsm==0.4.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
matt2000commented, Mar 13, 2019

Alternatively, if there were a way to tell poetry to explicitly prevent the installation of some package, that would help, at least.

0reactions
zupocommented, Feb 16, 2020

I have exactly the same problem, openapi-core 0.11.1 is using sys.version_info to declare requirements and I get enum34 installed in Python 3.7 environment. Which fails spectacularly.

I know that the openapi-core package author should fix this by using Environmental Markers. But there hasn’t been a release in months.

Ideally, poetry would support temporarily fixing such broken packages by overriding their dependency declarations. Basically what was proposed in https://github.com/python-poetry/poetry/issues/1122#issuecomment-565433003 sounds absolutely epic.

Here’s a workaround for anyone interested:

  1. run poetry lock
  2. manually remove all mentions of enum34 from poetry.lock
  3. run poetry install
  4. repeat every time you add a new package, or update an existing one
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve Python poetry dependency error - Stack Overflow
Running the reverse command poetry config virtualenvs.create true solved the problem (maybe add --local to set it to individual projects).
Read more >
Simple index - piwheels
... wymypy outshine modern-greek-inflexion explosig-data basicpreprocessing mdx-poetic tox-globinterpreter django-survey-and-report epparsers customcrypto ...
Read more >
Python Package Managers Explained - Inedo Blog
Thankfully, pip automates package management by first resolving all dependencies then proceeding to install the request packages.
Read more >
Software Packages in "jammy", Subsection python - Ubuntu
... python3-arpys (2.0.2-3) [universe]: ARPES (Angle Resolved PhotoEmission ... (1.7.0-2) [universe]: retrieve and print Python 3 package dependencies ...
Read more >
devel/py-setuptools: Python packages installer - FreshPorts
There is no configure plist information for this port. Dependency lines: ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR}. To install the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found