简体   繁体   中英

Python installation in custom directory (Linux): PIP not working

I have installed Python3.6.4 in a Linux machine, under a user directory, lets say /drive/username/Python3.6.4
I've setup my path and aliases, and Python is working properly (ie executing python3 puts me in the correct environment, which python3 produces: /drive/username/Python3.6.4/bin/python3 )

The problem is with pip ! When i execute pip3 , i am getting:
-bash: /username/Python3.6.4/bin/pip3: /usr/local/bin/python3.6: bad interpreter: No such file or directory

the command which pip3 gives: /drive/username/Python3.6.4/bin/pip3

What am i missing?

On my PC:

$ cat /usr/bin/pip3.6 
#!/usr/bin/python
...

So, I think your pip has shebang like #!/usr/local/bin/python3.6 .

Try rewrite or:

/drive/username/Python3.6.4/bin/python3 -m ensurepip

it will make correct pip in /drive/username/Python3.6.4/bin directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM