-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Jinja 3.0.1 cannot be non-binary installed with pip #1496
Comments
Is it missing markupsafe dependency? |
I can't reproduce this issue. |
This is the error I get: $ mkdir bla
$ cd bla/
$ virtualenv venv
created virtual environment CPython3.8.10.final.0-64 in 143ms
creator CPython3Posix(dest=/tmp/bla/venv, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/h/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
$ source venv/bin/activate
(venv)
$ pip install --no-binary :all: jinja2
Collecting jinja2
Using cached Jinja2-3.0.1.tar.gz (267 kB)
ERROR: Command errored out with exit status 1:
command: /tmp/bla/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q5fgq2p6/jinja2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q5fgq2p6/jinja2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-q5fgq2p6/jinja2/pip-egg-info
cwd: /tmp/pip-install-q5fgq2p6/jinja2/
Complete output (37 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-q5fgq2p6/jinja2/setup.py", line 4, in <module>
setup(
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 121, in setup
dist.parse_config_files()
File "/tmp/bla/venv/lib/python3.8/site-packages/_virtualenv.py", line 21, in parse_config_files
result = old_parse_config_files(self, *args, **kwargs)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/dist.py", line 701, in parse_config_files
parse_configuration(self, self.command_options,
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 121, in parse_configuration
meta.parse()
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 426, in parse
section_parser_method(section_options)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 399, in parse_section
self[name] = value
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 184, in __setitem__
value = parser(value)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 515, in _parse_version
version = self._parse_attr(value, self.package_dir)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 349, in _parse_attr
module = import_module(module_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/tmp/pip-install-q5fgq2p6/jinja2/src/jinja2/__init__.py", line 8, in <module>
from .environment import Environment as Environment
File "/tmp/pip-install-q5fgq2p6/jinja2/src/jinja2/environment.py", line 15, in <module>
from markupsafe import Markup
ModuleNotFoundError: No module named 'markupsafe'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. |
Ouch, it works on ArchLinux with Python 3.9, but does not work on Ubuntu LTS 20.04 with Python 3.8. |
Would you please show the logs when you tried this? Because I made it work using a newer pip, but what it does is end up installing an old version of jinja. Thanks! |
Also, would you please re-open this issue? Jinja is broken in some situation, let's find out why. |
Due to pallets/jinja#1496, we cannot use the latest Jinja2 packages inside the operator. The breaking change was introduced in Jinja2's 3x branch, and this change pins the `jinja2` dependency to the latest 2x release.
@davidism how can we debug this further? This issue is appearing in more projects. |
Perhaps you need to update pip and setuptools in your virtualenv, but a completely vanilla venv works fine for me. I do not consider this an issue with Jinja based on the information available.
|
This gets even weirder updating pip: it crashes with Jinja2 3.0.1, tries 3.0.0 and fails again, and finally installs 2.11.3. $ pip install -U pip
Collecting pip
Downloading pip-21.2.4-py3-none-any.whl (1.6 MB)
|████████████████████████████████| 1.6 MB 5.4 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Uninstalling pip-20.0.2:
Successfully uninstalled pip-20.0.2
Successfully installed pip-21.2.4
(venv)
$ pip list
Package Version
------------- -------
pip 21.2.4
pkg_resources 0.0.0
setuptools 44.0.0
wheel 0.34.2
(venv)
$ pip install --no-cache-dir --no-binary :all: jinja2
Collecting jinja2
Downloading Jinja2-3.0.1.tar.gz (267 kB)
|████████████████████████████████| 267 kB 5.1 MB/s
ERROR: Command errored out with exit status 1:
command: /tmp/bla/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-y_nye7la/jinja2_465a6e599e22447289ca7fc5a85cdeae/setup.py'"'"'; __file__='"'"'/tmp/pip-install-y_nye7la/jinja2_465a6e599e22447289ca7fc5a85cdeae/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-sm1bajq6
cwd: /tmp/pip-install-y_nye7la/jinja2_465a6e599e22447289ca7fc5a85cdeae/
Complete output (37 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-y_nye7la/jinja2_465a6e599e22447289ca7fc5a85cdeae/setup.py", line 4, in <module>
setup(
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 121, in setup
dist.parse_config_files()
File "/tmp/bla/venv/lib/python3.8/site-packages/_virtualenv.py", line 21, in parse_config_files
result = old_parse_config_files(self, *args, **kwargs)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/dist.py", line 701, in parse_config_files
parse_configuration(self, self.command_options,
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 121, in parse_configuration
meta.parse()
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 426, in parse
section_parser_method(section_options)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 399, in parse_section
self[name] = value
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 184, in __setitem__
value = parser(value)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 515, in _parse_version
version = self._parse_attr(value, self.package_dir)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 349, in _parse_attr
module = import_module(module_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/tmp/pip-install-y_nye7la/jinja2_465a6e599e22447289ca7fc5a85cdeae/src/jinja2/__init__.py", line 8, in <module>
from .environment import Environment as Environment
File "/tmp/pip-install-y_nye7la/jinja2_465a6e599e22447289ca7fc5a85cdeae/src/jinja2/environment.py", line 15, in <module>
from markupsafe import Markup
ModuleNotFoundError: No module named 'markupsafe'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/39/11/8076571afd97303dfeb6e466f27187ca4970918d4b36d5326725514d3ed3/Jinja2-3.0.1.tar.gz#sha256=703f484b47a6af502e743c9122595cc812b0271f661722403114f71a79d0f5a4 (from https://pypi.org/simple/jinja2/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Downloading Jinja2-3.0.0.tar.gz (267 kB)
|████████████████████████████████| 267 kB 91.3 MB/s
ERROR: Command errored out with exit status 1:
command: /tmp/bla/venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-y_nye7la/jinja2_2c2a8e8eb00c494b931f224b829378da/setup.py'"'"'; __file__='"'"'/tmp/pip-install-y_nye7la/jinja2_2c2a8e8eb00c494b931f224b829378da/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-u_55jq7z
cwd: /tmp/pip-install-y_nye7la/jinja2_2c2a8e8eb00c494b931f224b829378da/
Complete output (37 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-y_nye7la/jinja2_2c2a8e8eb00c494b931f224b829378da/setup.py", line 4, in <module>
setup(
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 121, in setup
dist.parse_config_files()
File "/tmp/bla/venv/lib/python3.8/site-packages/_virtualenv.py", line 21, in parse_config_files
result = old_parse_config_files(self, *args, **kwargs)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/dist.py", line 701, in parse_config_files
parse_configuration(self, self.command_options,
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 121, in parse_configuration
meta.parse()
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 426, in parse
section_parser_method(section_options)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 399, in parse_section
self[name] = value
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 184, in __setitem__
value = parser(value)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 515, in _parse_version
version = self._parse_attr(value, self.package_dir)
File "/tmp/bla/venv/lib/python3.8/site-packages/setuptools/config.py", line 349, in _parse_attr
module = import_module(module_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/tmp/pip-install-y_nye7la/jinja2_2c2a8e8eb00c494b931f224b829378da/src/jinja2/__init__.py", line 8, in <module>
from .environment import Environment
File "/tmp/pip-install-y_nye7la/jinja2_2c2a8e8eb00c494b931f224b829378da/src/jinja2/environment.py", line 14, in <module>
from markupsafe import Markup
ModuleNotFoundError: No module named 'markupsafe'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/7a/0c/23cbcf515b5394e9f59a3e6629f26e1142b92d474ee0725a26aa5a3bcf76/Jinja2-3.0.0.tar.gz#sha256=ea8d7dd814ce9df6de6a761ec7f1cac98afe305b8cdc4aaae4e114b8d8ce24c5 (from https://pypi.org/simple/jinja2/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Downloading Jinja2-2.11.3.tar.gz (257 kB)
|████████████████████████████████| 257 kB 100.4 MB/s
Collecting MarkupSafe>=0.23
Downloading MarkupSafe-2.0.1.tar.gz (18 kB)
Skipping wheel build for jinja2, due to binaries being disabled for it.
Skipping wheel build for MarkupSafe, due to binaries being disabled for it.
Installing collected packages: MarkupSafe, jinja2
Running setup.py install for MarkupSafe ... done
Running setup.py install for jinja2 ... done
Successfully installed MarkupSafe-2.0.1 jinja2-2.11.3
$ pip list
Package Version
------------- -------
Jinja2 2.11.3
MarkupSafe 2.0.1
pip 21.2.4
pkg_resources 0.0.0
setuptools 44.0.0
wheel 0.34.2 Running Python 3.8.10 on Ubuntu 20.04. |
It sounds like an issue with your Python/virtualenv/pip/setuptools. That's where I'd investigate next. I'm sorry, I can't help you debug this more at this point. |
Note that updating pip is not the same as updating pip and setuptools. You currently have a 2 year old version of setuptools acording to |
Updating both
|
Updating only setup tools fixed the issue also. Is this an issue on the Ubuntu package for setuptools? |
Trying to install Jinja 3.0.1 in a clean environment, using pip in "no binary" mode, fails with
ModuleNotFoundError: No module named 'markupsafe'
Log:
Note that some older version installs OK:
The same thing (installation ok) should happen in modern Jinja.
Environment:
Thank you!!
The text was updated successfully, but these errors were encountered: