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.

Installing cryptography on system using poetry fails

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).

  • OS version and name: Ubuntu 18.04, python3.8

  • Poetry version: 1.1.4

  • contents of your pyproject.toml file:

[tool.poetry]
name = "poetry_bug"
version = "0.1.0"
description = ""
authors = []

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

[tool.poetry.dev-dependencies]

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

Issue

The issue, installing cryptography within a virtualenv works, but I configure poetry config virtualenvs.create false and try to install it fails.

It seems that for the virtualenv poetry selects cryptography-3.2.1-cp35-abi3-manylinux1_x86_64.whl, however for the system install it selects cryptography-3.2.1-cp35-abi3-manylinux2010_x86_64.whl.

The following Dockerfile reproduces the issue:

FROM ubuntu:18.04

RUN apt update && apt install -y python3.8 python3-pip curl git
RUN python3.8 -m pip install poetry
ADD pyproject.toml .
RUN poetry config virtualenvs.create false
RUN poetry add cryptography==3.2.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
Casyfillcommented, Jun 3, 2021

Having the same issue with cryptography, on the newest poetry 1.1.6 and with the newest pip 21.0.1

end of the log:

    /Users/philippk/anaconda3/include/openssl/x509.h:573:45: note: passing argument to parameter 'palg' here
                               const X509_ALGOR **palg, const X509 *x);
                                                  ^
      54 warnings and 4 errors generated.
      error: command 'gcc' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /Users/philippk/Dropbox/se_projects/4_Automation/se_research/.venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jx/385bflkd3ldghxp3chpylgv00000gn/T/pip-req-build-u8gympth/setup.py'"'"'; __file__='"'"'/private/var/folders/jx/385bflkd3ldghxp3chpylgv00000gn/T/pip-req-build-u8gympth/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/jx/385bflkd3ldghxp3chpylgv00000gn/T/pip-record-wny5lf4q/install-record.txt --single-version-externally-managed --compile --install-headers /Users/philippk/Dropbox/se_projects/4_Automation/se_research/.venv/include/site/python3.7/cryptography Check the logs for full command output.
  

  at ~/.poetry/lib/poetry/utils/env.py:1074 in _run
      1070│                 output = subprocess.check_output(
      1071│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1072│                 )
      1073│         except CalledProcessError as e:
    → 1074│             raise EnvCommandError(e, input=input_)
      1075│ 
      1076│         return decode(output)
      1077│ 
      1078│     def execute(self, bin, *args, **kwargs):

(base) ZG00021:se_research philippk$ 
0reactions
yoav-orcacommented, Nov 10, 2020

I’m trying to use poetry to install all dependencies as global in a container, we are migrating away from pipenv and in pipenv we just used pipenv install --system.

Thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to install cryptography package with Poetry on Python 3.9
The solution for this poetry problem here is to install cryptography on its own before you install poetry.
Read more >
Frequently asked questions - pyca/cryptography
Installing cryptography fails with error : Can not find Rust compiler ¶ ; cryptography from source requires you have Rust installed and available...
Read more >
Need help with django site, can'y deploy - Render community
Not able to deploy django project from github. Command ['/opt/render/project/src/.venv/bin/pip', 'install', '--no-deps', ...
Read more >
T274310 Building wheels for cryptography package requires ...
This seems to be caused by the Step 8/25 : RUN python3 "-m" "pip" "install" "-U" "poetry==1.1.4" step in building the container. Potentially...
Read more >
ERROR: Failed building wheel for cryptography
i get this after running python3 -m pip install --upgrade homeassistant in the correct container: error: can't find Rust compiler If you are ......
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