我有一个我想发送给其他人的Python项目。我正在尝试创建一个 unignts.txt
文件,其中包含此脚本所需的依赖项,以便我的合作伙伴可以运行脚本。
我尝试安装 pipreqs
这样的: pip install pipreqs
。
这将输出以下内容:
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
Requirement already satisfied: pipreqs in c:\python310\lib\site-packages (0.4.11)
Requirement already satisfied: yarg in c:\python310\lib\site-packages (from pipreqs) (0.1.9)
Requirement already satisfied: docopt in c:\python310\lib\site-packages (from pipreqs) (0.6.2)
Requirement already satisfied: requests in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from yarg->pipreqs) (2.26.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from requests->yarg->pipreqs) (1.26.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from requests->yarg->pipreqs) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from requests->yarg->pipreqs) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from requests->yarg->pipreqs) (2.0.11)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
You should consider upgrading via the 'C:\Python310\python.exe -m pip install --upgrade pip' command.
然后,我尝试通过运行命令:
pipreqs ./my_calc.py
从包含Python脚本的文件夹中创建 unignts.txt
文件,我会收到以下错误:
bash: pipreqs: command not found
为什么我不能使用 pipreqs
?我一直使用 PIP安装
其他库。
另外,我在Windows计算机上。是否有一种更简单的方法来创建 unigess.txt
即使手动即使文件?
这些是唯一的进口:
import pandas as pd
import os
import openpyxl
import os.path
import math
from tkinter import filedialog
I have a Python project that I would like to send to someone else. I am trying to create a requirements.txt
file containing the required dependencies for this script so that my partner can run the script.
I tried installing pipreqs
like this: pip install pipreqs
.
This outputs the following:
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
Requirement already satisfied: pipreqs in c:\python310\lib\site-packages (0.4.11)
Requirement already satisfied: yarg in c:\python310\lib\site-packages (from pipreqs) (0.1.9)
Requirement already satisfied: docopt in c:\python310\lib\site-packages (from pipreqs) (0.6.2)
Requirement already satisfied: requests in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from yarg->pipreqs) (2.26.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from requests->yarg->pipreqs) (1.26.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from requests->yarg->pipreqs) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from requests->yarg->pipreqs) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\nroll97\appdata\roaming\python\python310\site-packages (from requests->yarg->pipreqs) (2.0.11)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
You should consider upgrading via the 'C:\Python310\python.exe -m pip install --upgrade pip' command.
I then tried to create the requirements.txt
file by running the command:
pipreqs ./my_calc.py
from the folder that contains the Python script and I get the following error:
bash: pipreqs: command not found
Why can't I use pipreqs
? I use pip install
all the time for other libraries.
Also, I am on a Windows computer. Is there an easier way to create the requirements.txt
file even if its manually?
These are the only imports:
import pandas as pd
import os
import openpyxl
import os.path
import math
from tkinter import filedialog
发布评论
评论(1)
我仍然无法使
pipreqs
正常工作,所以我刚刚通过首先了解了使用哪些版本的Python模块来手动制作unigess.txt
文件。我发现这样的是这样:
然后从这样的值中创建
support.txt
(但仅用于标准Python库中尚未包含的导入):I still wasn't able to get the
pipreqs
to work so I just made therequirements.txt
file manually by first finding out which versions of the Python modules are being used.I found that out like this:
And then created the
requirements.txt
from those values like this (but only for the imports that are not already included in the standard Python library):