-1

I created python virtual env using below command

python3 -m venv env

But I am not able to run pip inside it to install dependencies, can someone please help, though I can see pip present inside bin

(env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ ls -lart
    total 44
    drwxrwxr-x 5 s s 4096 Jan 11 08:49 ..
    lrwxrwxrwx 1 s s    7 Jan 11 08:49 python3.10 -> python3
    lrwxrwxrwx 1 s s   16 Jan 11 08:49 python3 -> /usr/bin/python3
    lrwxrwxrwx 1 s s    7 Jan 11 08:49 python -> python3
    -rwxrwxr-x 1 s s  284 Jan 11 08:50 pip3.10
    -rwxrwxr-x 1 s s  284 Jan 11 08:50 pip3
    -rwxrwxr-x 1 s s  284 Jan 11 08:50 pip
    -rw-r--r-- 1 s s 9033 Jan 11 08:50 Activate.ps1
    -rw-r--r-- 1 s s 2100 Jan 11 08:50 activate.fish
    -rw-r--r-- 1 s s  958 Jan 11 08:50 activate.csh
    -rw-r--r-- 1 s s 2032 Jan 11 08:50 activate
    drwxrwxr-x 2 s s 4096 Jan 11 08:50 .
    (env) s@s-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ python3 -m pip install -r requirements.txt
    /home/s/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/python3: No module named pip
    (env) s@s-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ pip install tensorflow
    Traceback (most recent call last):
      File "/home/s/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/pip", line 5, in <module>
        from pip._internal.cli.main import main
    ModuleNotFoundError: No module named 'pip'
    (env) s@s-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ python3 --version
    Python 3.7.16

Already tried steps(didn't work) 1.

u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p$ sudo apt-get install python3-pip
[sudo] password for u: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (22.0.2+dfsg-1).
0 upgraded, 0 newly installed, 0 to remove and 165 not upgraded.
(env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p$ python3 -m pip install -r requirements.txt
/home/u/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/python3: No module named pip
(env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p$ python3 -m pip3 install -r requirements.txt
/home/u/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/python3: No module named pip3
(env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p$ pip3 install -r requirements.txt
Traceback (most recent call last):
  File "/home/u/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/pip3", line 5, in <module>
    from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'
(env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ sudo apt install python3-pip
python3-pip is already the newest version (22.0.2+dfsg-1).
0 upgraded, 0 newly installed, 0 to remove and 165 not upgraded.
(env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ pip3 --version
Traceback (most recent call last):
  File "/home/u/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/pip3", line 5, in <module>
    from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'
souradeep majumdar
  • 137
  • 1
  • 1
  • 17

2 Answers2

-1

Try python3 -m pip3 install -r requirements.txt

If pip3 isn't found, it seems you need to install pip/pip3.

DiddlyDoo
  • 11
  • 1
  • (env) souradeep@souradeep-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p$ python3 -m pip install -r requirements.txt /home/souradeep/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/python3: No module named pip (env) souradeep@souradeep-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p$ ls 1_Image_Annotation 2_Training 3_Inference Data env get-pip.py LICENSE Minimal_Example.py README.md requirements.txt TrainYourOwnYOLO.ipynb Utils same issue – souradeep majumdar Jan 11 '23 at 06:02
  • It looks like you still didn't try pip3 instead of pip. Have you ensured you have pip(3) installed after activating your env? – DiddlyDoo Jan 11 '23 at 06:08
  • cd env/bin/ ls activate activate.csh activate.fish Activate.ps1 pip pip3 pip3.10 python python3 python3.10 pip -version pip3 --version op: Traceback (most recent call last): File "/home/u/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/pip3", line 5, in from pip._internal.cli.main import main ModuleNotFoundError: No module named 'pip' (env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ – souradeep majumdar Jan 11 '23 at 06:12
  • i can see the pip and pip3 files but when you try running either gives the same error – souradeep majumdar Jan 11 '23 at 06:13
  • (env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ sudo apt install python3-pip python3-pip is already the newest version (22.0.2+dfsg-1). 0 upgraded, 0 newly installed, 0 to remove and 165 not upgraded. (env) u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p/env/bin$ pip3 --version Traceback (most recent call last): File "/home/u/Documents/github/CarPartsDetectionChallenge_v3p/env/bin/pip3", line 5, in from pip._internal.cli.main import main ModuleNotFoundError: No module named 'pip' – souradeep majumdar Jan 11 '23 at 06:17
-1

Link your python with the pip package manager :

After activating the virtual Environment run the below commands.

For Windows :

python3 -m ensurepip

For Linux :

sudo apt-get install python3-pip
ikurious
  • 36
  • 7
  • u@u-Lenovo-ideapad-520-15IKB:~/Documents/github/CarPartsDetectionChallenge_v3p$ sudo apt-get install python3-pip [sudo] password for u: Reading package lists... Done Building dependency tree... Done Reading state information... Done python3-pip is already the newest version (22.0.2+dfsg-1). 0 upgraded, 0 newly installed, 0 to remove and 165 not upgraded. still same issue – souradeep majumdar Jan 11 '23 at 06:04