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

Error after pip install | ModuleNotFoundError: No module named 'markupsafe' #2

Open
rvernica opened this issue May 16, 2022 · 3 comments
Assignees
Labels
bug Something isn't working stale
Milestone

Comments

@rvernica
Copy link

Description

Python setup broken after pip install sphinx_jinja2_compat

Steps to Reproduce

  1. pip install sphinx_jinja2_compat
  2. python

Actual result:

> pip install sphinx_jinja2_compat
Defaulting to user installation because normal site-packages is not writeable
Collecting sphinx_jinja2_compat
  Using cached sphinx_jinja2_compat-0.1.2-py3-none-any.whl (12 kB)
Requirement already satisfied: markupsafe>=1 in /usr/lib64/python3.10/site-packages (from sphinx_jinja2_compat) (2.0.0)
Requirement already satisfied: jinja2>=2.10 in /usr/lib/python3.10/site-packages (from sphinx_jinja2_compat) (3.0.1)
Installing collected packages: sphinx-jinja2-compat
Successfully installed sphinx-jinja2-compat-0.1.2

> python
Error processing line 1 of /home/foo/.local/lib/python3.10/site-packages/_sphinx_jinja2_compat.pth:

  Traceback (most recent call last):
    File "/usr/lib64/python3.10/site.py", line 186, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "/home/foo/.local/lib/python3.10/site-packages/sphinx_jinja2_compat/__init__.py", line 44, in <module>
      import markupsafe  # noqa: E402
  ModuleNotFoundError: No module named 'markupsafe'

Remainder of file ignored
Python 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import markupsafe
>>> markupsafe.__version__
'2.0.0'

Reproduces how often:

I tried all available versions of the package 0.1.0-0.1.2

Version

  • Operating System: Fedora 35
  • Python: 3.10
  • sphinx-jinja2-compat: 0.1.0-0.1.2

Installation source

PyPI

Other Additional Information:

Don't really need the package, it just came up with the sphinx-toolbox package.

@rvernica rvernica added the bug Something isn't working label May 16, 2022
@domdfcoding
Copy link
Member

I think I see the issue. You have jinja2 and markupsafe installed in /usr/lib64/python3.10/site-packages (presumably by yum) but sphinx-jinja2-compat in /home/foo/.local/lib/python3.10/site-packages/. It looks like /usr/lib64/python3.10/site-packages isn't yet on the Python path when sphinx-jinja2-compat tries to do its thing, hence the error.

I have implemented a workaround in version 0.2.0b1. Can you try with that version? (pip install sphinx-jinja2-compat==0.2.0b1)

@domdfcoding domdfcoding added this to the 0.2.0 milestone May 17, 2022
@rvernica
Copy link
Author

This seems to work. It produces some printout which I guess is for debugging:

> pip install sphinx-jinja2-compat==0.2.0b1
...
Successfully installed sphinx-jinja2-compat-0.2.0b1

> python
abrt_exception_handler3
sitecustomize
usercustomize
Python 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
readline
atexit
rlcompleter
inspect
ast
_ast
dis
opcode
_opcode
linecache
tokenize
token
>>> 

@MatthewFlamm
Copy link

I also had this problem. While upgrading to 0.2.0b1 removes the error, I also get the print statements. Is there a method to turn those off?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants