Closed Opalo closed 10 months ago
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
If I were to guess, you probably have the PIP_USER=1
set somewhere.
That was it, very helpful! Thanks you very much!!
I want to generate a lock file using airlfow dockerfile. The reason for that is that the lock file be used to install the dependencies later on on the exactly the same file. Unfortunately the
pip-compile
fails with:Environment Versions
Python 3.9.18
pip 23.0.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
7.3.0
Steps to replicate
FROM apache/airflow:${AIRFLOW_VERSION}-python${PYTHON_VERSION}
RUN pip install pip-tools==7.3.0
VOLUME /app
WORKDIR /app
ENTRYPOINT []
[build-system] requires = [ "setuptools>=63.0.0", "wheel" ] build-backend = "setuptools.build_meta"
[project] name = "whatever" version = "1.0.0" description = "LOL" dependencies = [ "apache-airflow-providers-presto==5.1.4" ] requires-python = ">=3.9"
docker build -t lol .
docker run --rm -v $PWD:/app --entrypoint /bin/bash -it lol
pip-compile -o pyproject.lock pyproject.toml
airflow@0e10011b11cc:/app$ pip-compile -o pyproject.lock pyproject.toml ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
[notice] A new release of pip is available: 23.2 -> 23.3.1 [notice] To update, run: python -m pip install --upgrade pip Traceback (most recent call last): File "/home/airflow/.local/bin/pip-compile", line 8, in
sys.exit(cli())
File "/home/airflow/.local/lib/python3.9/site-packages/click/core.py", line 1157, in call
return self.main(args, kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/airflow/.local/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home/airflow/.local/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(args, *kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), args, **kwargs)
File "/home/airflow/.local/lib/python3.9/site-packages/piptools/scripts/compile.py", line 551, in cli
metadata = project_wheel_metadata(
File "/home/airflow/.local/lib/python3.9/site-packages/build/util.py", line 47, in project_wheel_metadata
env.install(builder.build_system_requires)
File "/home/airflow/.local/lib/python3.9/site-packages/build/env.py", line 143, in install
_subprocess(cmd)
File "/home/airflow/.local/lib/python3.9/site-packages/build/env.py", line 64, in _subprocess
subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/tmp/build-env-0phmpzua/bin/python', '-Im', 'pip', 'install', '--use-pep517', '--no-warn-script-location', '-r', '/tmp/build-reqs-6bv05q8q.txt']' returned non-zero exit status 1.
ModuleNotFoundError: No module named 'poetry'