Pip-tools: pip-compile always creates a dummy file

Created on 16 Feb 2020  路  7Comments  路  Source: jazzband/pip-tools

Whenever I use pip-compile, it creates a dummy file with name like .__atomic-writeg1jehpnz....

Environment Versions

  1. OS Type: Windows 10
  2. Python version: 3.7.3
  3. pip version: 20.0.2
  4. pip-tools version: 4.4.1

Expected result

I expect requirements.txt with proper package list to be generated.

Actual result

It always creates a dummy file with the proper result.
I tried without requirements.txt according to the README.
But it always creates an empty requirements.txt and a dummy file.
I always copy contents from the dummy file to the requirements.txt and remove the dummy file.
It's annoying and not sure why this happens.
Am I missing something?

support

Most helpful comment

I must note that pip-tools doesn't work well with stream redirecting. Be careful with that. Better to use --output-file option. Glad to help!

All 7 comments

Hello @FreelanceDev217,

Thanks for the issue! Unfortunately, I couldn't reproduce it locally. Could you please provide additional details?

  • Which requirements.in do you use?
  • Which command do you run to compile requirments?
  • Could you attach an output from compile command with --verbose flag?

Which requirements.in do you use?

sqlalchemy

Which command do you run to compile requirments?

`pip-compile requirements.in > requirements.txt

Could you attach an output from compile command with --verbose flag?

(DFS_DB~1) F:\167 NBA_Fantasy\Python\DFS_DB_Manage>pip-compile requirements.in > requirements.txt --verbose
Using indexes:
  https://pypi.org/simple

                          ROUND 1
Current constraints:
  decouple (from -r requirements.in (line 2))
  sqlalchemy (from -r requirements.in (line 1))

Finding the best candidates:
  found candidate decouple==0.0.7 (constraint was <any>)
  found candidate sqlalchemy==1.3.13 (constraint was <any>)

Finding secondary dependencies:
  sqlalchemy==1.3.13        requires -
  decouple==0.0.7           requires -
------------------------------------------------------------
Result of round 1: stable, done

#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile requirements.in
#
decouple==0.0.7
sqlalchemy==1.3.13

After running, .__atomic-writeqepebgwb is genereated with the output of pip-compile.
And a new blank requirements.txt is generated too.

Could you try this command instead?

$ pip-compile requirements.in --output-file requirements.txt

That does the trick. Maybe > is not well recognized in Windows?

pip-compile prints the output to stderr (not stdout), that's why > requirements.txt makes the requirements file empty.

Thank you very much for your kind help.

I must note that pip-tools doesn't work well with stream redirecting. Be careful with that. Better to use --output-file option. Glad to help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

atugushev picture atugushev  路  4Comments

ssbarnea picture ssbarnea  路  5Comments

blampe picture blampe  路  4Comments

vphilippon picture vphilippon  路  4Comments

astrojuanlu picture astrojuanlu  路  3Comments