I'm trying to create a pdf file inside a python/django project. I'm using PyLatex, which helps, but it's generate_pdf method breaks when it calls pdflatex. I keep getting this error:
FileNotFoundError: [Errno 2] No such file or directory: 'pdflatex'
I tried everything - os.system() ... subprocess. Any way I try, it can't find pdflatex. I'm running on Windows, but I need to be able to to do this within the web-app anyway.
Thanks for any help!
You just need to install pdflatex (and you will need to install on your server when you release your web-app). Instructions for installing on windows can be found in the top answer here.
Do you have "pdflatex" installed? As per this question, you may have to install "MiKTeX" and point os.system() at C:\Program Files\MiKTeX <MikTeX version>\miktex\bin to make it work.
Hope that helps.
Do you have texlive installed? If yes, then the issue is with the system path variable. If not already added, add it to the system path.
#
Updated answer:
I took the time and decided to replicate your issue. I too use windows.
I copied the basic example from Pylatex and tested it on my machine, I was able to replicate the same error as you despite having TexLive installed. To solve it I did the following steps:
Installed MikTex (I believe you have it installed).
Tried running it again but failed with the error missing package latexmk.
Using MikTex package manager, I installed the latexmk package.
Tried running but still failed, error missing perl.exe command.
I had to install perl to my windows, use the following links -- https://learn.perl.org/installing/windows.html
When I tried again, it compiled successfully.
The issue was not having the package latexmk for MikTex and perl.exe of which you should have posted as part of the error logs. Try that and let me know if successful.
Related
I am trying to install python-magic for Windows and I have followed all the instructions in https://github.com/ahupp/python-magic and repeated the process several times but I am still getting this error:
ImportError: failed to find libmagic. Check your installation
I have magic1.dll (along with the two other files the docs specified) in C:\Windows\System32 so I am not sure what the issue is. I would appreciate any help or workarounds.
Go here and download the file "python_magic_bin-0.4.14-py2.py3-none-win32.whl", then
pip install python_magic_bin-0.4.14-py2.py3-none-win32.whl
now python-magic works
I know this is a Windows question, but i wanted to share a Debian solution:
apt-get install libmagic-dev
Kind regards.
The below original answer is now outdated. Please simply follow the instructions denoted under the "dependencies" section.
ORIGINAL ANSWER:
I was able to solve this problem by moving the 3 files from GNUWin32 project to a separate directory (not the \system32 directory the docs suggest) and adding them to the PATH environment variable
Follow the below steps.
go to > https://github.com/pidydx/libmagicwin64
download the 3 files (dll's) except readme.md file
Drop the 3 files (dlls ) in C:\Windows\System32 and python magic will
import correctly.
Installing Cygwin with libmagic libary and installing the most recent version of the module from Github solves this problem.
At the time this question was asked, https://github.com/ahupp/python-magic probably didn't support cygmagic-1.dll.
This question is not a duplicate of this question, because I am trying to create an app.
I am currently following this tutorial, but when I try to run my app,
my command prompt prints out this error:
Why does this error happen and how can I solve it? I read through all the answers to the linked question, but none of them are pertinent to my problem.
Please anyone help me, I still haven't found a working solution; I am getting desperate!!!
Edit: I can't just install and uninstall pynput? Idk why it doesn't work because shouldn't pynput come with idle?
Version: 3.74 python idle, most updated version of pyinstaller
The following might help you if you haven't tried them already:
Update pip from the command line
Unistall pyinstaller
Re-install pyinstaller and try it again
If the above does not work, try running the following command in the command line. Make sure there are some print statements in your code to see if it works.
python monitoring_culmination_product.py
If you got a message saying "python is not recognised as an internal or external command" then python might have not been added as an environment path.Try this to fix the issue.
You could always re-install python if things get difficult.(make sure you install the appropriate version 32-64bit)
If the command though executed without a problem. Try to use pyinstaller on another file to see if the problem has to make sure the problem has to do with pyinstaller.
From a personal experience, pyinstaller can be unreliable at times so I put the following line in my projects just to make sure. It might help you too.
import pkg_resources.py2_warn
Disclaimer: Although it is not specified I assume that you are using Windows
You could try to use conda create to get an environment containing all the need dependencies (numpy, etc) and then use pyinstaller as explained in this discussion.
Please fall back to 1.6.8 version of pynput. pip install pynput==1.6.8
Ref : https://stackoverflow.com/a/63721929/14759065
Description
When I tried to install package sacrebleu, I got an error like this:
Installation Error
It said "System cannot find the specified file". However I have no idea how to solve it.
I have tried installing package mecab-python3. But it confuses me that it was successfully installed in Anaconda but got an error, "Microsoft Visual C++ 14.0 is required", in original python38 environment.
Whether the package mecab-python3 has been installed or not, I still got the same error and cannot install sacrebleu.
I also tried restarting my machine but it does not work.
Is there anyone could solve it? or I want to know if there is any alternative package I can use to calculate BLEU score.
Thanks Anyway!
My Environment
Windows 10
Python 3.8
pip 20.1.1
Anaconda3 v4.8.2
I'm the mecab-python3 maintainer. Sorry it's giving you trouble.
The README has a link to the C++ runtime pack you have to install on Windows, if you install that it should work.
I have heard reports of the package not working with Anaconda on Windows specifically, though it seems to work sometimes. If you have trouble please open an issue and I'll try to fix it. On the other hand, if you aren't processing Japanese there's no reason to import the module and that may be a bug in sacrebleu.
Ah, actually, I just saw your screenshot - didn't notice it before.
Versions before 1.0 don't support Windows. But to keep using the old dictionary, sacrebleu has to make some changes, so they don't support 1.0+ yet. I think they are working on it, see this issue.
I did everything given in their documentation but I'm getting this error again and again....I tried googling and finding if anyone got the same error but nopes, didn't work out. Heres the command --
bazel test --linkopt=-headerpad_max_install_names \
syntaxnet/... util/utf8/...
And heres the error -
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '#org_tensorflow//tensorflow:tensorflow.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
INFO: Elapsed time: 0.052s
ERROR: Couldn't start the build. Unable to run test
here is a very useful script for installation on ubuntu-14.04
https://github.com/JoshData/models/blob/b72274d38f169f77e6a15e54834f463f627dc82a/syntaxnet/build/ubuntu-14.04_x64.sh
Finally solved it, it was related to the bazel version.
I had installed it before, so the version was 0.1.5. But in the docs, its written supported ones are 0.2 - 0.2.2b. I tried to upgrade it using brew but it didn't work.
So I tried to directly install it using the 0.2.2b installer and it worked :)
First time I build an application for Windows, so I used Python+pyqt5 since I had good experience with C++/Qt5 on Linux.
I'm now trying to get an executable for deployment, but the one generated py2exe complained about missing the Qt Windows plugin. I moved to pyqtdeploy as it seemed to be more specifically designed with pyqt in mind, but after setting the paths I just get an "Unable to copy file error".
Anybody got an idea how to get this to work?
The locations I set are as follows:
Interpreter: C:\Python34\python.exe
Include Directory: C:\Python34\include
Python Library: C:\Python34\DLLs\python3.dll
Standard Library Directory: C:\Python34\Lib
Today, I faced the same problem. After some debugging I found out that pyqtdeploy looks for the correct bootstrap-<version>.py script it wants to use, by looking at the version in the filename of the Python library (python3.dll in our case).
The solution is to use <windows-dir>\system32\python34.dll or <python-install-dir>\python34.dll as the Python library. The former will be present when you install Python for all users, the latter will be present when you install Python "just for me" (see this screenshot).
After renaming python3.dll to python34.dll, everything worked again.