Following is an excerpt from the requirements.txt
file. I understand the value after ==
specifies the version. What does the value after =
specify? Can I exclude it?
icu==67.1=he1b5a44_0
lz4-c==1.9.2=he6710b0_1
xz==5.2.5=h7b6447c_0
qt==4.8.7=2
Following is an excerpt from the requirements.txt
file. I understand the value after ==
specifies the version. What does the value after =
specify? Can I exclude it?
icu==67.1=he1b5a44_0
lz4-c==1.9.2=he6710b0_1
xz==5.2.5=h7b6447c_0
qt==4.8.7=2
This happens if the file is created by exporting a conda environment (and in this case it should normally be called something like environment.yml
, i.e. a yml file).
If one creates this file with the basic command
conda env export > environment.yml
it exports the strictest definition of the packages, which includes the build number (that's what you see after the second =
), and it is often OS-specific. That guarantees that you can reproduce exactly the same environment as the original (but will also not work on other OSs). This issue is also captured in this question. In the vast majority of cases, you should be fine without it and you're free to remove the build numbers. If you have access to this environment, you can export it "properly", like
conda env export > environment.yml --no-build
It signifies that you don't actually have a pip requirements.txt
file in the first place. This is a conda export, likely created with conda list --export
, and can not be processed with pip.
The value after the =
is just a build string, you may think of it is as an identifier to allow installing this exact same build. A version number is not sufficient here, since you may have different builds of the same version.
Example showing the h7b6447c_0
build of the xz
package that you referenced:
$ conda search xz=5.2.5 --info
Loading channels: done
xz 5.2.5 h7b6447c_0
-------------------
file name : xz-5.2.5-h7b6447c_0.tar.bz2
name : xz
version : 5.2.5
build : h7b6447c_0
build number: 0
size : 438 KB
license : LGPL-2.1 and GPL-2.0
subdir : linux-64
url : https://repo.anaconda.com/pkgs/main/linux-64/xz-5.2.5-h7b6447c_0.tar.bz2
md5 : e17620ef8fc8654e77f53b4f2995b288
timestamp : 2020-04-16 04:36:07 UTC
dependencies:
- libgcc-ng >=7.3.0
Due to requirements.txt doc there is nothing about them, It seems like they are meaningless for pip.
https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format