Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install module - /bin/pip: No such file or directory #470

Closed
nzagorchev opened this issue Sep 3, 2017 · 16 comments
Closed

Cannot install module - /bin/pip: No such file or directory #470

nzagorchev opened this issue Sep 3, 2017 · 16 comments

Comments

@nzagorchev
Copy link

Hello,

Trying to install a module fails with the following error:
/bin/sh: /bin/pip: No such file or directory

I am using MacOS and have installed python and python3 using homebrew.
Then installed pipenv using pip3.

which pip returns:
/usr/local/bin/pip
and pip itself is found as a command.

However, if I use python -m pip --version it points to the default MacOS python:
pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)

I am unaware where it tries to resolve pip from and does not find it.
I am not sure if there is a problem with my $PATH paths or the issue is different.

Thank you for your time!

@kennethreitz
Copy link
Contributor

Try the fancy installation method

@erinxocon
Copy link
Contributor

Second. Pipsi is the way to go for installing python cli utils

@nzagorchev
Copy link
Author

Thanks for the replies.

I first uninstalled and installed again python and python3 using homebrew and also re-installed pip.
Then I was able to successfully install pipenv using pipsi by the provided link for the fancy installation.

However, trying to install any module, I know get the following error:
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 7, in
from pipenv import cli
File "/usr/local/lib/python3.6/site-packages/pipenv/init.py", line 13, in
from .cli import cli
File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 11, in
import background
ModuleNotFoundError: No module named 'background'

@nzagorchev
Copy link
Author

Using pip3 I installed background and semver.

Now I am facing another issue:
ModuleNotFoundError: No module named 'piptools'
$ pip3 install piptools
Collecting piptools
Could not find a version that satisfies the requirement piptools (from versions: )
No matching distribution found for piptools

I believe there might be a root cause of the above since I am not sure if all those errors are expected.
Your help is much appreciated.

@nzagorchev
Copy link
Author

nzagorchev commented Sep 4, 2017

Typo in the pip-tools. Installed them and now I am back at square one with the initial error:
/bin/sh: /bin/pip: No such file or directory

@kennethreitz
Copy link
Contributor

Do you have PYTHONHOME set or something?

@nzagorchev
Copy link
Author

No, I do not.

pip is available in terminal.
$ which pip
/usr/local/bin/pip

but it is only 'attached' to python2 and python3 but not the default python:
$ python -m pip
/usr/bin/python: No module named pip

Any ideas on what could be wrong?

@nzagorchev
Copy link
Author

nzagorchev commented Sep 5, 2017

Seems the root cause was that pew was not working due to not set locale.
Setting it in .bash_profile seems to resolve the issue.

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

Will further test and later update if this is solved.

@kennethreitz
Copy link
Contributor

💫✨🍰✨💫

@kennethreitz
Copy link
Contributor

We should check for this and add some pretty error message if it's not set.

@erinxocon
Copy link
Contributor

@kennethreitz should pew check for this or should pipenv?

@kennethreitz
Copy link
Contributor

@erinxocon pew should.

@Manmanthan
Copy link

$ hash -r
Reset your bash cache. It will solve the problem.

@thehesiod
Copy link

I was having an issue only on codebuild, and this solved it for me: #1929

@trinanda
Copy link

Maybe this will help newbies like me in the future.
I Following @nzagorchev comment:

add @nzagorchev script in your ~/.bash_profile or ~/.zshrc

sudo vim ~/.bash_profile
or
sudo vim ~/.zshrc if you're using zsh

then add the following script to the file

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

then run this command:

source ~/.bash_profile
or
source ~/.zshrc if you're using zsh

then close your terminal and open it again.

after that, it works perfectly :)

@stivesdt
Copy link

Me funciono esta opcion
$pip install -U pip
$which pip
/usr/bin/pip

$hash -r
$which pip
/usr/local/bin/pip
Referencia: https://stackoverflow.com/questions/16237490/i-screwed-up-the-system-version-of-python-pip-on-ubuntu-12-10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants