Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
269 views
in Technique[技术] by (71.8m points)

python - Way to differentiate linux packages from requirements.txt?

I've been given a deep learning model developed in linux OS. I am using Windows10 OS.

While trying to replicate it on my local (windows) machine I faced a problem when trying to download multiple requirements.

requirments.txt looks something like this:

apturl==0.5.2
asn1crypto==0.24.0
bleach==2.1.2
Brlapi==0.6.6
certifi==2020.11.8

I know that apturl, Brlapi are linux packages therefore I take it out of requirements.txt file and run it in Dockerfile using following command

RUN apt update && apt install -y htop python3-dev wget 
    apturl==0.5.2 
    Brlapi==0.6.6

since requirements.txt contain lots of packages to be installed and I do not know which belong to linux is there easy way to separate them? Right now I am running it and when error occurs on certain package, google it then if it belong to linux, move it do Dockerfile command to install.

Am I just supposed to know which packages belong to which and separate them on my own?

Thanks in advance!

question from:https://stackoverflow.com/questions/65896709/way-to-differentiate-linux-packages-from-requirements-txt

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

apt is used for managing system packages on debian based operating systems. Although it can install some python packages if they were packaged and available as debian packages, it is generally not used for this purpose.

The tool commonly used for managing python packages is pip and requirments.txt file is usually used to specify the python package dependency details. If you have python3 installed on your local system, try python3 -m pip install -r requirements.txt or pip3 install -r requirements.txt (replace python3/pip3 with python/pip if required).

TLDR: The packages in requirements.txt are python packages and not system packages. So your OS shouldn't matter here as long you have python installed.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...