I have a requirements.txt file which holds all information of my python packages I need for my Flask application. Here is what I did:
python3 -m venv venv
source venv/bin/activate
sudo pip install -r requirements.txt
When I tried to check if the packages were installed on the virtual environment using pip list
, I do not see the packages. Can someone tell what went wrong?
(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$
Advertisement
Answer
If you want to use python3+ to install the packages try to use pip3 install package_name
And to solve the errno 13 try to add –user at the end
pip3 install package_name --user
let me know if it works