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.

[now dev] fails with @now/python on Debian/Ubuntu

See original GitHub issue

Ubuntu, since Xenial, contains the patched version of pip with --user and --ignore-installed flag active by default. In combination with the --prefix option, from the @now/python runtime, this always raises an error distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base.

This can be solved by running now dev as a superuser or using the non-system version of pip.

For solving this in the runtime either --system or --no-user (depends on pip version) option must be provided. However, export PIP_USER=0 PIP_IGNORE_INSTALLED=0 seems more applicable.

There are also similar issues: #3023 and #2853

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
numrutcommented, Oct 22, 2019

Please try this:

FROM ubuntu:latest

RUN apt-get update && apt-get install -y python3-pip

RUN useradd -m user && \
  su - user -c "pip3 install --disable-pip-version-check --target . --upgrade Flask"
0reactions
styflecommented, Oct 16, 2019

I was unable to reproduce this bug with ubuntu xenial.

Here’s what I tried:

FROM ubuntu:xenial
RUN apt-get update && \
  apt-get install python3 python3-pip && \
  pip3 --version &&
  echo 'Flask==1.0.3' > requirements.txt && \
  pip3 install --disable-pip-version-check --target . --upgrade -r requirements.txt

The pip version was 8.1.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

[now dev] fails with @now/python on Debian/Ubuntu #3089
This can be solved by running now dev as a superuser or using the non-system version of pip . For solving this in...
Read more >
Problem installing Python-Dev - Ask Ubuntu
It all started when I tried to install another Python package and got the error: SystemError: Cannot compile 'Python.h'. Perhaps you need to...
Read more >
Getting started with Python Algorand SDK and Django
Run the development server now ( python manage.py runserver ) and point your browser to the root page ( http://127.0.0.1:8000/ ).
Read more >
virtualenv 1.11.4 - PyPI
Fixed Issue #373. virtualenv-1.8.4 was failing in cygwin (Pull #382). Fixed Issue #378. virtualenv is now “multiarch” aware on debian/ubuntu (Pull #379).
Read more >
Python Development - Unit Testing - GitHub Pages
This page provides general Python development guidelines and source build ... Now python-test.exe or simply ctest (to run all tests) should work.
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