当前位置:网站首页>PIP free export with path (@ file: / / /) notes

PIP free export with path (@ file: / / /) notes

2022-04-23 05:15:00 zzzzls~

problem

stay conda Use in sandbox environment pip freeze > requirements.txt Command to export installed modules , Some of these modules show @ file:///..., Not the specific version number , Here's the picture :

 Insert picture description here
here , If we use it directly on other machines pip install -r requirements.txt When installing the module , You will encounter the following errors :

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such
file or directory: 'C:\\ci\\cffi_1600699250966\\work'

reason

This is a pip A special syntax for installing software packages ( since 19.1 Start supported )PEP404,
But this path depends on the environment ,file:///URL Available only on the local file system , You can't put the generated requirements.txt Make the file available to others

solve

When you encounter such problems , You can temporarily consider using the following command to generate requirements.txt file

pip list --format=freeze > requirements.txt

In the file exported with the above command , It will contain the following packages :distribute,pip,setuptools,wheel, It is recommended to manually delete !

Reference resources

版权声明
本文为[zzzzls~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220547251903.html