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

Mac : fail to launch Python 3.8 #83578

Closed
SebastienFoo mannequin opened this issue Jan 20, 2020 · 8 comments
Closed

Mac : fail to launch Python 3.8 #83578

SebastienFoo mannequin opened this issue Jan 20, 2020 · 8 comments
Labels

Comments

@SebastienFoo
Copy link
Mannequin

SebastienFoo mannequin commented Jan 20, 2020

BPO 39397
Nosy @ronaldoussoren, @vstinner, @ned-deily, @methane

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-01-22.12:46:34.794>
created_at = <Date 2020-01-20.15:57:36.687>
labels = ['OS-mac', '3.8', 'expert-installation', 'invalid']
title = 'Mac : fail to launch Python 3.8'
updated_at = <Date 2020-01-22.12:46:34.793>
user = 'https://bugs.python.org/SebastienFoo'

bugs.python.org fields:

activity = <Date 2020-01-22.12:46:34.793>
actor = 'methane'
assignee = 'none'
closed = True
closed_date = <Date 2020-01-22.12:46:34.794>
closer = 'methane'
components = ['Installation', 'macOS']
creation = <Date 2020-01-20.15:57:36.687>
creator = 'Sebastien Foo'
dependencies = []
files = []
hgrepos = []
issue_num = 39397
keywords = []
message_count = 8.0
messages = ['360322', '360354', '360359', '360364', '360376', '360377', '360387', '360453']
nosy_count = 5.0
nosy_names = ['ronaldoussoren', 'vstinner', 'ned.deily', 'methane', 'Sebastien Foo']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue39397'
versions = ['Python 3.8']

@SebastienFoo
Copy link
Mannequin Author

SebastienFoo mannequin commented Jan 20, 2020

Hello,
I am facing an issue with python on mac and there is not much information that I can find to fix it.
When I installed the latest cli for Azure (brew upgrade azure-cli) it installed python 3.8
And then the az cli failed and running the python 3.8 failed too with the following error.

/usr/local/Cellar/python@3.8/3.8.1/Frameworks/Python.framework/Versions/3.8/bin/python3.8
Fatal Python error: config_get_locale_encoding: failed to get the locale encoding: nl_langinfo(CODESET) failed
Python runtime state: preinitialized

I have tried to reinstall python and the azure cli without success.

Any help would be much appreciated.

@SebastienFoo SebastienFoo mannequin added 3.8 only security fixes topic-installation labels Jan 20, 2020
@methane
Copy link
Member

methane commented Jan 21, 2020

Try locale command. What is shown?

@vstinner
Copy link
Member

Can you try to dump your environment variables? Try maybe the "env" command.

At least, I would need: LC_ALL, LC_CTYPE and LANG.

@ronaldoussoren
Copy link
Contributor

An additional question: what version of macOS are you using?

@SebastienFoo
Copy link
Mannequin Author

SebastienFoo mannequin commented Jan 21, 2020

thanks averyone to help me
here are the values you are expecting

locale
LANG="en_US"
LC_COLLATE="en_US"
LC_CTYPE="en_US"
LC_MESSAGES="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_ALL=

doing env I get this (no LC_ALL )
LC_TERMINAL_VERSION=3.3.7
ITERM_PROFILE=zsh
XPC_FLAGS=0x0
LANG=en_US
SHELL=/usr/local/bin/zsh
TERM_PROGRAM_VERSION=3.3.7
TERM_PROGRAM=iTerm.app
LC_TERMINAL=iTerm2
LC_CTYPE=en_US

And for the last question I am using Catalina 10.15.2

@methane
Copy link
Member

methane commented Jan 21, 2020

doing env I get this (no LC_ALL )
[snip]
LC_CTYPE=en_US

This is wrong setting. Find where this environment variable is set and remove it.

@ronaldoussoren
Copy link
Contributor

The other locale related settings are off as well, the default system locale ends with ".UTF-8".

@SebastienFoo
Copy link
Mannequin Author

SebastienFoo mannequin commented Jan 22, 2020

Thanks a lot for you help, my issue is solved.
My ~/.zshrc was having a LANG env var set to

LANG=en_US

I just commented out this line and everything works fine.
I don't know why this was set like that.

Thanks again for your time you can close this ticket.

@methane methane closed this as completed Jan 22, 2020
@methane methane closed this as completed Jan 22, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants