-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Warn pipenv and black users when LC_ALL isn't set #1403
Comments
Probably part of #648 |
The underlying problem is #1254 |
If we do #1338 and log the entire environment then this can help with this as well by providing people with those details (but it's also a lot of info, so we might want to still limit what we send to the Output window). |
Talking with Christian at the PyCon US sprints, Python 3.7 is setting |
What we might need to do is also provide whatever shell details we can to help people realize why when they have set their |
And if we can tell people which shell is being used then that might also help (e.g. if someone thinks they are using bash when in fact we are using just |
My guess is we're executing in a login, non-interactive shell and people are setting stuff in |
Is there a workaround for this to set |
@pzelnip manually setting it depends on your shell. If you're using Bash then try your |
@brettcannon My apologies, I misunderstood the conversation earlier, I assumed that from the comment "My guess is we're executing in a login, non-interactive shell and people are setting stuff in .bashrc and their .bash_profile is not sourcing their .bashrc" that changes to my bash_profile/bashrc wouldn't be reflected in the integrated VS Code terminal (which I'm assuming is where Black runs when spawned by VS Code). As it turns out, in my case the way I got it working was by setting What's interesting to me at least is black was working in a Terminal window before this change (just not in VS Code). Digging into it, on my machine in a plain terminal I had the I'm guessing that In any case, thanks for the workaround. 👍 |
The workarounds above don't seem to work for me. I'm on High Sierra, and I just installed vs-code and the python extension (2018.8.0). I've tried adding LC_ALL to my bash_profile and bashrc files without any effect, using both export and the launchctl commands mentioned in other issues. I've uninstalled and reinstalled vs-code. I've tried launching it from finder and from the console. I've also added confirmed that in the console (both inside and outside vs-code), the environment variables are set correctly and Workspace contains pipfile but attempt to run 'pipenv --venv' failed with 'Traceback (most recent call last): File "/Users/wcass/.local/bin/pipenv", line 11, in sys.exit(cli()) File "/Users/wcass/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in call return self.main(*args, **kwargs) File "/Users/wcass/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 676, in main _verify_python3_env() File "/Users/wcass/.local/lib/python3.6/site-packages/pipenv/vendor/click/_unicodefun.py", line 118, in _verify_python3_env 'for mitigation steps.' + extra) RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult http://click.pocoo.org/python3/for mitigation steps. This system lists a couple of UTF-8 supporting locales that you can pick from. The following suitable locales where discovered: af_ZA.UTF-8, am_ET.UTF-8, be_BY.UTF-8, bg_BG.UTF-8... The pipenv is running python 3.6.5 installed via pyenv, and is having the same Click issue that has been mentioned elsewhere. Regardless of what I do, I can't seem to pass the enviroment variables on to the python extension so that it can execute pipenv. Any ideas how to get this to work? |
@wcass77 I'll assume you didn't choose what your terminal is. That last option is |
Unfortunately, that didn't work for me either. It's perhaps not a great idea, but I decided to just change the code inside click to set the locale to 'en_US.utf-8' (my actual locale) before checking what the locale is. This isn't for a production project, and I'm just changing it to what it will be when pipenv is called from the command line, so I don't think it should cause issues. In the file
To this:
There is probably a better way to change the locale (or at least a better place to put it), but this seemed like the most direct way to ensure that it was set to the correct value when it mattered, and changing the code inside pipenv/click is not a problem in my particular use case. I hope this helps. |
@wcass77 If you can switch to Python 3.7 then that might also help as there was work to try and alleviate this kind of locale issue. And sorry for the trouble. I'm hoping we can address this (and other shell-related issues) in the near future. |
No problem. I need to use 3.6 for this particular project, but I will
definitely keep it in mind. Now that I've got everything working, I'm
definitely enjoying vs code, and it's great to have it automatically run
tools like pylint in the right environment. Thanks!
…On Tue, Sep 11, 2018 at 2:36 PM Brett Cannon ***@***.***> wrote:
@wcass77 <https://github.com/wcass77> If you can switch to Python 3.7
then that might also help as there was work to try and alleviate this kind
of locale issue.
And sorry for the trouble. I'm hoping we can address this (and other
shell-related issues) in the near future.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1403 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABwjNdVfEVrRDLSanSwufrr1RHSSvGiJks5uaAK_gaJpZM4TXXZt>
.
|
Closing as this hasn't been reported in the past few releases. |
See #1027
The text was updated successfully, but these errors were encountered: