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

pkg_resources.extern.packaging.markers.UndefinedEnvironmentName Exception #501

Closed
willypuzzle opened this issue May 30, 2017 · 10 comments
Closed

Comments

@willypuzzle
Copy link

When I try the command:

$pybabel extract -F babel.cfg -o messages.pot .

I receive this output:

...
extracting messages from app/templates/auth/login.html (extensions="jinja2.ext.autoescape,jinja2.ext.with_")
Traceback (most recent call last):
File "/var/www/python/flask-foundation/env/bin/pybabel", line 11, in
sys.exit(main())
...
pkg_resources.extern.packaging.markers.UndefinedEnvironmentName: 'extra' does not exist in evaluation environment.

Why? I read it can depend from pip but I have the last upgraded version. This is my babel.cfg file:

[python: **.py]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_

I use python 3.

@halfnibble
Copy link

halfnibble commented Jul 20, 2017

I'm having this issue now. Latest Ubuntu LTS and its latest Python3 and pip.

@benselme
Copy link
Member

Could it be the same problem as in this issue ?
getsentry/sentry#3143

@Mark-Wellings
Copy link

Mark-Wellings commented Aug 30, 2017

I'm afraid it's not the same issue. Just tried downgrading and it didnt work. If you dont reference jinja2 it does run, but for me creates an empty messages.pot
babel.cfg

[python: **/FlaskApp/**.py]

encoding = utf-8
extensions=jinja2.ext.autoescape,jinja2.ext.with_,webassets.ext.jinja2.AssetsExtension
silent=False

@akx
Copy link
Member

akx commented Aug 31, 2017

@Mark-Wellings Could you create a repo with a minimal test case that exhibits this problem?

@Mark-Wellings
Copy link

Mark-Wellings commented Sep 2, 2017

I think my issue was related to how my app is organized. Reading all *.py files on the server gave me an error. Now I've got it set up so that it only reads init.py, that's the babel.cfg

[python: **__.py]
[jinja2: **.html]
encoding = utf-8
extensions=jinja2.ext.autoescape,jinja2.ext.with_
silent=False

@guoweikuang
Copy link

After upgrading setuptools (pip install --upgrade setuptools) from 20.7.0 to 35.0.1 it works now.

@akx
Copy link
Member

akx commented Jan 15, 2018

Closing this as it seems upgrading setuptools will fix this issue. :)

@akx akx closed this as completed Jan 15, 2018
michilu added a commit to michilu/deploy-gh-pages that referenced this issue Mar 2, 2018
@horejsek
Copy link

It happens again with setuptools 39.2.0, works until 39.1.0.

@JimmyTheNerd
Copy link

It happens again with setuptools 39.2.0, works until 39.1.0.

Works with setuptools 40.5.0.

@trideceth12
Copy link

It happens again with setuptools 39.2.0, works until 39.1.0.

Works with setuptools 40.5.0.

Not for me.. I had to pip install setuptools==39.1.0 to fix this ( I was on 40.5.0 before)

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

9 participants