Skip to content

pew which is in $PATH is not found #913

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

Closed
aCandidMind opened this issue Oct 16, 2017 · 21 comments
Closed

pew which is in $PATH is not found #913

aCandidMind opened this issue Oct 16, 2017 · 21 comments
Labels
Type: Possible Bug This issue describes a possible bug in pipenv.

Comments

@aCandidMind
Copy link

For me on ubuntu there's a warning about pew not being in the path, while it certainly is.

$ python --version
Python 3.5.4
$ pip --version
pip 9.0.1 from /home/bogn/.pyenv/versions/3.5.4/lib/python3.5/site-packages (python 3.5)
$ pyenv --version
pyenv 1.1.5-7-gaf8cca9
$ pipenv --version
pipenv, version 8.2.7
$ pipenv install flask
Creating a virtualenv for this project…
⠋Warning: it looks like pew is not in your PATH. We cannot continue until this is resolved.
$ pew version
1.1.0

At first I thought that the issue is that I modified the $PATH in ~/.bashrc, not in ~/.profile. But after adding it to .profile as well it still doesn't work. Note that I've used pyenv and it's plugin python-build to install python. Installing and uninstalling pew[pythonz] didn't help either. Reinstalling pipenv also wasn't succesful.

Expected result

I would have expected that pipenv creates a new env and installs flask into it.

Actual result

$ pipenv install flask --verbose
Creating a virtualenv for this project…
⠋Warning: it looks like pew is not in your PATH. We cannot continue until this is resolved.

@aCandidMind
Copy link
Author

aCandidMind commented Oct 16, 2017

Installing pew and pipenv via pipsi didn't help either.

Another note: I had pipenv working in September. That was with an older Python (3.4.2). But somehow it vanished and is also no longer in that version ;-)

Sadly it's now no longer installable.

@aCandidMind
Copy link
Author

I completely removed python 3.5.4 and installed 3.6.2. The first things I did (differently) this time was
$ pip install virtualenv
$ pip install pew
and only then I installed pipenv via
$ pip install --user pipenv
And this time it worked. Are these dependencies that should always be installed first? If so https://docs.pipenv.org/install.html#installing-pipenv should cover this. In the bottom on the pipsi installation pew is installed first.

@techalchemy
Copy link
Member

Sorry you encountered this issue. Typically in order to provide insight it would require more context. You referenced your path, but we would need to see it. In all likelihood the issue is that the subshell that pipenv is spawning is not provided with the environment information to access pew.

The code in question is literally just, essentially, delegator.run(['pew', 'new', '-d',...). There's no magic here, and definitely doesn't depend upon the order in which you run installation commands. It just tries to run pew, and if it can't, it lets you know. Realistically we would have needed to see the output of env when things were broken. Since it's too late now and this is fixed, it's probably impossible to say why this was broken.

@erinxocon
Copy link
Contributor

Also pew is the backup "fancy" install method. Do you have the env variable set to always do fancy installs with pipenv?

@erinxocon erinxocon added the Type: Possible Bug This issue describes a possible bug in pipenv. label Oct 18, 2017
@premiumrainwater
Copy link

I have the same problem

I ran into this problem while I was following this guide and when running

pip install requests

and the error is this

Warning: PYENV_ROOT is not set. New python paths will probably not be exported properly after installation. Creating a virtualenv for this project… ⠋Warning: it looks like pew is not in your PATH. We cannot continue until this is resolved.

My $PATH returns this

`/Users/adeka/bin:/usr/local/bin:/Users/adeka/bin:/usr/local/bin:/Users/adeka/.pyenv/shims:/usr/local/Cellar/pyenv-virtualenv/1.1.1/shims:/Users/adeka/.pyenv/shims:/usr/local/Cellar/pyenv-virtualenv/1.1.1/shims:/Users/adeka/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin`

My pipenv -version rerturns this

`pipenv, version 8.2.7`

and when I run pip install pew i get this

Requirement already satisfied: pew in /Users/adeka/Library/Python/3.6/lib/python/site-packages Requirement already satisfied: setuptools>=17.1 in /usr/local/lib/python3.6/site-packages (from pew) Requirement already satisfied: virtualenv-clone>=0.2.5 in /usr/local/lib/python3.6/site-packages (from pew) Requirement already satisfied: virtualenv>=1.11 in /usr/local/lib/python3.6/site-packages (from pew)

I have tried a host of solutions but I haven't been able to get it to work. I did not want to follow this solution as it seems unsafe.

Any help is appreciated. 😀

@techalchemy
Copy link
Member

@anubhavdeka can you provide more info, like the output of env and which pew. Is PYENV_ROOT set? Is pew on your path?

@techalchemy
Copy link
Member

@anubhavdeka you need to have the pyenv shims directory ahead of /usr/local/bin on your path and you need to set the environment variable as described. Your path is pretty misconfigured too, you have the same paths appearing like 4 times each. You will also probably want ~/.local/bin on your path just after your pyenv shims folder.

@techalchemy
Copy link
Member

Also as I was just reminded you will want to make sure to configure your locale correctly with these environment variables:

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

@premiumrainwater
Copy link

@techalchemy thank you! I noticed that as well.

Here's the info you asked!

For env

TERM_SESSION_ID=w0t2p0:0EECD634-95DF-41C5-B5B8-235A968144AE SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.1shUNpZdSC/Listeners Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.Jme8ertchS/Render COLORFGBG=15;0 ITERM_PROFILE=Default XPC_FLAGS=0x0 PWD=/Users/adeka SHELL=/usr/local/bin/zsh LC_CTYPE=UTF-8 TERM_PROGRAM_VERSION=3.1.4.beta.1 TERM_PROGRAM=iTerm.app PATH=/Users/adeka/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin COLORTERM=truecolor TERM=xterm-256color HOME=/Users/adeka TMPDIR=/var/folders/dg/kdt2pkxd1gs930kzcy49p4x80000gn/T/ USER=adeka XPC_SERVICE_NAME=0 LOGNAME=adeka __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0 ITERM_SESSION_ID=w0t2p0:0EECD634-95DF-41C5-B5B8-235A968144AE SHLVL=1 OLDPWD=/Users/adeka ZSH=/Users/adeka/.oh-my-zsh PAGER=less LESS=-R LSCOLORS=Gxfxcxdxbxegedabagacad LANG=en_US.UTF-8 _=/usr/bin/env

and for which pew I get this

/usr/local/bin/pew

I think most of my problems are with the $PATH being wrong because every time I do pipenv install requests I get the following error

Creating a virtualenv for this project… ⠋Traceback (most recent call last): File "/usr/local/bin/pew", line 7, in <module> from pew.pew import pew File "/Users/adeka/Library/Python/3.6/lib/python/site-packages/pew/__init__.py", line 11, in <module> from . import pew File "/Users/adeka/Library/Python/3.6/lib/python/site-packages/pew/pew.py", line 42, in <module> from pew._utils import (check_call, invoke, expandpath, own, env_bin_dir, File "/Users/adeka/Library/Python/3.6/lib/python/site-packages/pew/_utils.py", line 22, in <module> encoding = locale.getlocale()[1] or 'ascii' File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py", line 581, in getlocale return _parse_localename(localename) File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py", line 490, in _parse_localename raise ValueError('unknown locale: %s' % localename) ValueError: unknown locale: UTF-8 Virtualenv location: Installing requests… ⠸ Error: An error occurred while installing requests! /bin/sh: /bin/pip: No such file or directory

I am going to remove the duplicate entries and try again. Hope the information you asked for helps! 😀

@premiumrainwater
Copy link

Yes I added the locales and the error about the wrong locales have disappeared. Thank you!

@erinxocon
Copy link
Contributor

Thanks for using pipenv @anubhavdeka

@ninrod
Copy link

ninrod commented Feb 16, 2018

what if I'm on windows? what is the course of action? setting up these variables does not work.

@techalchemy
Copy link
Member

@ninrod then I suspect it would just mean that you need pew to be on your path, which means that the path where python libraries are installed needs to be on your path

@ninrod
Copy link

ninrod commented Feb 16, 2018

@techalchemy, very interesting. I'll try that. python -m pip install pew surely does not work.

Also, I cannot run pipenv directly on my path. I have to go through python: python -m pipenv [command]. Should pipenv be available on my path, as python is? If so, it may really be a PATH problem.

@uranusjr
Copy link
Member

@ninrod What platform are you on , and how did you install Pipenv? You may need to add additional PATH configuration under certain circumstances.

@ninrod
Copy link

ninrod commented Feb 17, 2018

@uranusjr I'm on windows 10, sadly. I just downloaded the instaler from python.org and put the python/bin folder in my path. Now I'm able to use python through window cmd shell. But pip is not on my path. To use pip I have to issue python -m pip [subcommand]. And I did not find any instructions on how to configure this on windows.

@uranusjr
Copy link
Member

This is indeed a PATH issue then. You need to also add the Scripts directory (the one at the same location as python.exe) to your PATH. Commands such as pew and pip are installed there by default.

@ninrod
Copy link

ninrod commented Feb 17, 2018

yes! that was it. now everything is working lovely. in my case, I had to add the D:\Program Files (x86)\Python36-32\Scripts\ path to the global path. I've uninstalled and reinstalled pipenv with pip install pipenv and it all works now.

@srivalli1123
Copy link

@ninrod how did you add the path to the global path?

@ninrod
Copy link

ninrod commented Mar 7, 2018

in windows, you just open my computer, right click, properties and then you have an entry where you can add environment variables.

@Teuop
Copy link

Teuop commented Mar 7, 2018

FYI, changing "~/.local/bin/" to "$HOME/.local/bin" in my .bash_aliases fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Possible Bug This issue describes a possible bug in pipenv.
Projects
None yet
Development

No branches or pull requests

8 participants