Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to allow unverified packages in requirements.txt

Tags:

python

pip

I get the following error on installing ahocorasick on a server:

Some insecure and unverifiable files were ignored (use --allow-unverified ahocorasick to allow).

How do I modify the requirements.txt to allow unverified packages? The answer in Fresh deploy on Heroku fails with "use --allow-unverified PIL to allow" states that we can add --allow-unverified ahocorasick in the requirements.txt. But that is not working for me.

like image 460
Kechit Goyal Avatar asked Mar 20 '15 15:03

Kechit Goyal


People also ask

How to install Python packages from requirements txt file?

The text file name is “ requirements.txt “. 2. Use PIP To Install Python Packages From Requirements.txt File. The pip install command provides a -r argument, we can provide the above “ requirements.txt ” file path as the value to the -r argument, then it will install all packages written in the requirements.txt file.

Are requirements txt files enough to ensure predictable builds?

Requirements.txt files ensure predictable builds, but they don’t eliminate dependency problems completely. Even with version specifiers, requirement.txt files, and a package approval workflow, it's possible that a new vulnerability will be discovered in a dependency.

How do I remove a package from my requirements file?

You can always open your requirements.txt file and manually remove any extra packages. The code below shows a sample requirements.txt file gotten through pip freeze > requirements.txt One thing many people have noticed with some pip packages is that they put @ file:///* after some package name — were * as a wildcard character.

Why is the package name @/* instead of the package version?

Having @ file:///* after the package name instead of the package version is not good formatting for the requirements.txt file. It is an open issue identified in versions of pip such as 20.1 and 21.0.1. Again, the output requirements.txt file may have some extra packages, and you can always go into the file and manually remove them.


1 Answers

You need too add this line at the top of your requirements.txt

--allow-all-external

And then use --allow-unverified in desired packages.

like image 132
levi Avatar answered Oct 14 '22 06:10

levi