You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I installed
pyflakes
through pipx, but using the tool in another context fails, because that other context set a PYTHONPATH that interfer withpyflakes
import.How to reproduce
pyflakes
installed withPython 3.12
, somehow a script added an element toPYTHONPATH
that contains a re module compile forPython 3.11
. pyflakes wrongly pick up the PYTHON PATH instead of sticking within its venv.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.The text was updated successfully, but these errors were encountered: