Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Deciding if requirements.txt file was generated on a Debian OS and how to handle it on a different OS

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
Mircea
Posts: 1
Joined: 2022-08-09 18:57
Has thanked: 1 time

Deciding if requirements.txt file was generated on a Debian OS and how to handle it on a different OS

#1 Post by Mircea »

My question concerns requirements.txt files, that were generated in the context of .py codes used for classification, by different teams.
Each such requirements.txt file contains the list of (additional) packages that must be installed prior to running the corresponding .py codes.
I am unable to install the these files.

I tried installing them both on a cluster (running Red Hat) and on a Ubuntu virtual machine installed on the cluster.
I tried installing them using pip (i.e. using

Code: Select all

pip install -r requirements.txt
) and also using conda (i.e.

Code: Select all

conda install --file requirements.txt
).
Irrespective of the OS used, I always get the same errors.

When trying to install the file via pip, the error is:

Code: Select all

ERROR: Invalid requirement: 'python-scipy = 0.18.1-2~pn1' (from line 13 of dependencies.txt)
Hint: = is not a valid operator. Did you mean == ?
and when trying install the file via conda, the error writes:

Code: Select all

InvalidVersionSpec: Invalid version '0.18.1-2~pn1': invalid character(s)
Typically, the requirements.txt file contain lines like this:

Code: Select all

python-tensorflow = 1.0.0-0~pn1 
python-numpy      = 1:1.12.0-2~pn0 
i.e. as opposed to the "typical" requirements.txt file I encountered so far, they contain
the prefix "python-" before different packages (e.g. Numpy, Tensorflow)
the suffix "~pn0" or "~pn1" and the end.

I think all the requirements files I have were actually generated on a Debian OS, but I am not sure how to confirm this and I am not sure if there is any method that would allow me the handle these file (i.e. simply install them, via pip, conda or any other way). My questions are the following:

1. Is there any way to decide if the requirements.txt files that contain the elements listed above were generated on a Debian OS?
2. Could anyone suggest a way to install such files on a RedHat or Ubuntu OS? Are there other options beside pip and conda that I should try?

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 65 times

Re: Deciding if requirements.txt file was generated on a Debian OS and how to handle it on a different OS

#2 Post by LE_746F6D617A7A69 »

I'm not a python expert, but this sounds ridiculous:
Mircea wrote: 2022-08-09 19:22 I think all the requirements files I have were actually generated on a Debian OS
The problem that You have with the 'requirements.txt' file looks like a problem with encoding. I would first check the encoding of that file, and whether it uses BOM (Byte Order Mark - first 2 bytes in the file).
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

lindi
Debian Developer
Debian Developer
Posts: 412
Joined: 2022-07-12 14:10
Has thanked: 1 time
Been thanked: 77 times

Re: Deciding if requirements.txt file was generated on a Debian OS and how to handle it on a different OS

#3 Post by lindi »

Mircea wrote: 2022-08-09 19:22 Typically, the requirements.txt file contain lines like this:

Code: Select all

python-tensorflow = 1.0.0-0~pn1 
python-numpy      = 1:1.12.0-2~pn0 
As the error message says, "=" is not a valid operator. requirements.txt files cannot contain lines that contain " = " in them (it should be "=="). I think you should ask the person who created the file to explain what's going on, it's difficult for us to guess that.

Post Reply