gpt4 book ai didi

python包没有安装在使用ubuntu的虚拟环境中

转载 作者:行者123 更新时间:2023-12-04 18:59:12 25 4
gpt4 key购买 nike

我有一个 requirements.txt 文件,其中包含我的 Flask 应用程序所需的 python 包的所有信息。这是我所做的:

  • python3 -m venv venv
  • source venv/bin/activate
  • sudo pip install -r requirements.txt

  • 当我尝试使用 pip list 检查软件包是否安装在虚拟环境中时,我没有看到包。有人能说出出了什么问题吗?
    (venv) ubuntu@ip-xxx-xx-x-xxx:/var/www/html/flaskapp$ ls
    __pycache__ application.py flaskapp.wsgi requirements.txt utils.py venv
    (venv) ubuntu@ip-xxx-xx-x-xxx:/var/www/html/flaskapp$ sudo pip install -r requirements.txt
    Requirement already satisfied: certifi==2021.5.30 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 1)) (2021.5.30)
    Requirement already satisfied: charset-normalizer==2.0.4 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 2)) (2.0.4)
    Requirement already satisfied: click==8.0.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 3)) (8.0.1)
    Requirement already satisfied: filelock==3.0.12 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 4)) (3.0.12)
    Requirement already satisfied: Flask==2.0.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 5)) (2.0.1)
    Requirement already satisfied: huggingface-hub==0.0.12 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 6)) (0.0.12)
    Requirement already satisfied: idna==3.2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 7)) (3.2)
    Requirement already satisfied: itsdangerous==2.0.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 8)) (2.0.1)
    Requirement already satisfied: Jinja2==3.0.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 9)) (3.0.1)
    Requirement already satisfied: joblib==1.0.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 10)) (1.0.1)
    Requirement already satisfied: MarkupSafe==2.0.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 11)) (2.0.1)
    Requirement already satisfied: nltk==3.6.2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 12)) (3.6.2)
    Requirement already satisfied: numpy==1.21.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 13)) (1.21.1)
    Requirement already satisfied: packaging==21.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 14)) (21.0)
    Requirement already satisfied: Pillow==8.3.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 15)) (8.3.1)
    Requirement already satisfied: pyparsing==2.4.7 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 16)) (2.4.7)
    Requirement already satisfied: PyYAML==5.4.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 17)) (5.4.1)
    Requirement already satisfied: regex==2021.8.3 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 18)) (2021.8.3)
    Requirement already satisfied: requests==2.26.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 19)) (2.26.0)
    Requirement already satisfied: sacremoses==0.0.45 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 20)) (0.0.45)
    Requirement already satisfied: scikit-learn==0.24.2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 21)) (0.24.2)
    Requirement already satisfied: scipy==1.7.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 22)) (1.7.1)
    Requirement already satisfied: sentence-transformers==2.0.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 23)) (2.0.0)
    Requirement already satisfied: sentencepiece==0.1.96 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 24)) (0.1.96)
    Requirement already satisfied: six==1.16.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 25)) (1.16.0)
    Requirement already satisfied: textblob==0.15.3 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 26)) (0.15.3)
    Requirement already satisfied: threadpoolctl==2.2.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 27)) (2.2.0)
    Requirement already satisfied: tokenizers==0.10.3 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 28)) (0.10.3)
    Requirement already satisfied: torch==1.9.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 29)) (1.9.0)
    Requirement already satisfied: torchvision==0.10.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 30)) (0.10.0)
    Requirement already satisfied: tqdm==4.62.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 31)) (4.62.0)
    Requirement already satisfied: transformers==4.9.2 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 32)) (4.9.2)
    Requirement already satisfied: typing-extensions==3.10.0.0 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 33)) (3.10.0.0)
    Requirement already satisfied: urllib3==1.26.6 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 34)) (1.26.6)
    Requirement already satisfied: Werkzeug==2.0.1 in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 35)) (2.0.1)
    (venv) ubuntu@ip-xxx-xx-x-xxx:/var/www/html/flaskapp$ pip list
    Package Version
    ------------- -------
    pip 20.0.2
    pkg-resources 0.0.0
    setuptools 44.0.0
    (venv) ubuntu@ip-xxx-xx-x-xxx:/var/www/html/flaskapp$

    最佳答案

    如果您想使用 python3+ 安装软件包,请尝试使用 pip3 install package_name
    并解决 errno 13 尝试在最后添加 --user

    pip3 install package_name --user
    让我知道它是否有效

    关于python包没有安装在使用ubuntu的虚拟环境中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68837021/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com