-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Running pythontex in a virtual environment #3838
Comments
I added an init.py file to the out folder and the folder of the latex files. Not changing the error. |
Do I have to activate the .venv for the external tools (not needed in the terminal). I tried:
Not changing the error. |
Thanks for the question, indeed in the current External LaTeX tool run configuration the command is hardcoded and will be run outside the virtual environment. Could you try with a regular external tool, and then activate the virtual environment there? For example, (I think this functionality did not exist at the time I created the external tool run config, maybe it is obsolete now) |
What I tried is to write a bash script, that that sources the environment first and then executed pythontex. |
I just realised that just using a 'before launch' tool may not quite fix it, because you need to run LaTeX - pythontex - LaTeX. I think the best solution is to add environment variables to the External Tool run configuration, then you would be able to edit PATH so that pythontex will pick up the correct python executable. |
Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version
PyCharm
Operating System
Linux
TeXiFy IDEA version
0.9.9
What I did (steps to reproduce)
Added pythontex as external tool in before launch.
So my before lauch looks like:
Minimal example to reproduce the problem
Expected behavior
This behaviour works from the PyCharm terminal. Here the python version is: Python 3.12.6
Actual behavior
Get the error below.
Altough I have a .venv that works, has the correct python version as in the .python-version file.
Looks for me, that not the correct python python is used?
(if applicable) The full stacktrace of the exception thrown
The text was updated successfully, but these errors were encountered: