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

installed script lacks "-E" in their shebang #1584

Open
marmoute opened this issue Dec 4, 2024 · 0 comments
Open

installed script lacks "-E" in their shebang #1584

marmoute opened this issue Dec 4, 2024 · 0 comments

Comments

@marmoute
Copy link

marmoute commented Dec 4, 2024

I installed pyflakes through pipx, but using the tool in another context fails, because that other context set a PYTHONPATH that interfer with pyflakes import.

How to reproduce

pyflakes installed with Python 3.12, somehow a script added an element to PYTHONPATH that contains a re module compile for Python 3.11. pyflakes wrongly pick up the PYTHON PATH instead of sticking within its venv.

   $ pyflakes --version
+  Traceback (most recent call last):
+    File "HOME/.local/bin//pyflakes", line 3, in <module>
+      import re
+    File "OTHER/re/__init__.py", line 125, in <module>
+      from . import _compiler, _parser
+    File "OTHER/_compiler.py", line 18, in <module>
+      assert _sre.MAGIC == MAGIC, "SRE module mismatch"
+             ^^^^^^^^^^^^^^^^^^^
+  AssertionError: SRE module mismatch
+  [1]

Expected behavior

I would expect pipx to install standalone, isolated environment that are not affected by external factor. This expectation fails here.

Possible fixes ?

Install tools with -E in their shebang for appropriate isolation. I fixed my install that way.

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

1 participant