Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

741
Vistas
Using a pip requirements file in a conda yml file throws AttributeError: 'FileNotFoundError'

I have a requirements.txt like

numpy

and an environment.yml containing

# run via: conda env create --file environment.yml
---
name: test
dependencies:
  - python>=3
  - pip
  - pip:
      - -r file:requirements.txt

when I then run conda env create --file environment.yml I get

Pip subprocess output:

Pip subprocess error: ERROR: Exception:

<... error traceback in pip >

AttributeError: 'FileNotFoundError' object has no attribute 'read'

failed

CondaEnvException: Pip failed

It is also strange how pip is called, as reported just before the error occurs:

['$HOME/.conda/envs/test/bin/python', '-m', 'pip', 'install', '-U', '-r', '$HOME/test/condaenv.8d3003nm.requirements.txt']

(I replace my home path with $HOME) Note the weird expansion of the requirements.txt.

Any ideas?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Changes to Pip Behavior in 21.2.1

A recent change in the Pip code has changed its behavior to be more strict with respect to file: URI syntax. As pointed out by a PyPA member and Pip developer, the syntax file:requirements.txt is not a valid URI according to the RFC8089 specification.

Instead, one must either drop the file: scheme altogether:

name: test
dependencies:
  - python>=3
  - pip
  - pip:
    - -r requirements.txt

or provide a valid URI, which means using an absolute path (or a local file server):

name: test
dependencies:
  - python>=3
  - pip
  - pip:
    - -r file:/full/path/to/requirements.txt
    # - -r file:///full/path/to/requirements.txt # alternate syntax
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda