I have followed all the steps shared in all stackoverflow and other questions out there to install gettext for windows (10), but still, I get the error: "Can't find msguniq, make sure you have gettext tools installed" when using internationalization in django. I have tried to download the files directly and added them to the PATH, and even an installer that had already compiled everything and added to the path automatically, but it still doesn't work, and I don't know what else to do... Help please!
Thank you for your time.
I had the same problem. I tried various solutions to no avail. Finally, I downloaded the binaries from https://mlocati.github.io/articles/gettext-iconv-windows.html
and it worked.
Not sure what problem you face but below command worked for me
pip install python-gettext
In windows you just need to download :
gettext-tools-xx.zip
gettext-runtime-xx.zip
from here: enter link description here
and then you need to unzip them and copy all in bin folder of both files into C:\Program Files\gettext-utils\bin and then you need to go to control panel-> system -> advanced -> environment variables and add this path:C:\Program Files\gettext-utils\bin to path variables. Note:
xx is the version you want to download if you download version 18 you will get an error that some dll file is missing, I suggest to download version 17
this folder: gettext-utils\bin does not exist and you need to create it
restart your pc before you use gettext
Related
Recently I reinstall my VS Code due to some errors. But I am not able to compile python files. I have installed all necessary extensions like python and code runner. But still I am getting this:
Same problem occurred to me! All I did was just disabled and then re enabled the python extension again.
OR
Please uninstall the extension, restart VS Code, and then install it again. This error is symptomatic of an extension install going badly.
I tried everything to fix this problem
1.Unistall VS Code.
2.Go to "C:/Users/{Whatever User}" and delete the .vscode Folder.
3.Go to "C:/Users/{Whatever User}/AppData/Roaming" and delete the "Code" Folder. This file stores all the VS Code Cache.
4.Restart you laptop and install VS Code again.
5.Install the python extension.
Yes they solve my other errors related to VS Code but this particular error was in my folder from which I was running my python program because when I execute some other python program saved in some other directory it worked successfully.
So I would suggest that you may try running your .py file by placing it in some new folder.
I've just had exactly the same issue. My intellisense wouldn't work too. Tried everything.. at the end I've downgraded Jupyter version. Went back to version from 6 days ago and everything is working. Python, Pylance, Intellisense extensions are the newest.
one of the solutions is you should downgrade python extension to lower extension.
please click extensions icon then choose manage button below python extension.and click install another version.
then choose older version.then select interpreter(ctrl+shift+p).
at the end restart vscode and run python file.
Help Link How to Downgrade Extension
Just Update or Uninstall and Reinstall Pylance and Python extension from Extensions...and Restart VSCode....
You may need to roll back the VS Code Python extension temporarily.
See command 'python.execInTerminal-icon' not found #3003.
Same problem. My solution is downgrade both Jupyter and Python to 2021.3.6xxx from current 2021.5
Version: 1.56.1 (user setup)
Commit: e713fe9b05fc24facbec8f34fb1017133858842b
Date: 2021-05-06T10:08:05.141Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.19041
I was too lazy to follow the recommendations for reinstalling the program on the computer, so I went into the VSC extensions, uninstalled Python, restarted VSC, installed Python, restarted VSC and everything works now. If you are as lazy as I am, then you can try this method before taking drastic measures.
Even I had the same problem but I fixed it. To fix this you have to delete VS Code completely and then reinstall it. Follow the steps:
Unistall VS Code.
Go to "C:/Users/{Whatever User}" and delete the .vscode Folder.
Go to "C:/Users/{Whatever User}/AppData/Roaming" and delete the "Code" Folder. This file stores all the VS Code Cache.
Restart you laptop and install VS Code again.
Install the python extension.
This worked for me. Hope it helps you too.
Note: If you don't find the AppData folder in you users folder, you have to enable hidden items by going to the view section in the windows explorer taskbar.
Just uninstall python extension and then restart VS Code and then install python extension again and then you will not get this error anymore.
Just update or reinstall Pylance and Python extensions and restart VS Code.
Go to the python extension, hit the arrow next to uninstall and downgrade
I Tried uninstall Reinstall VS Code Windows 10 64 bit Not Worked.
Just Uninstall all extensions in VS code.
1.open any .py file
2.Then VS CODE will show automatically to install python extension.
3.Install It Now you can see the interpreter without any issue.
NOTE:(Tried uninstalling reinstalling Extensions one by one not solved the issue)
Same here. No I've tried to relaunch VS Code, but still no python, no terminal at all (neither "Code", "Problems", or other tabs), not even was able to load the extensions menu to reinstall python. But Relaunching the PC solved the issue :)
Just uninstall VS Code, go to C:\Users\whatever user\ and delete .vscode.
Restart pc and install latest version of VS Code.
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.
I am trying to extract tabular data from pdf using camelot and I am getting the following error.
Code:
tables = camelot.read_pdf(file_name)
Error:
GhostscriptNotFound: Please make sure that Ghostscript is installed and available on the PATH environment variable
I have already installed Ghostscript and I have it available on the PATH environment variable.
Please find below version details:
Windows-10-10.0.17134-SP0
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
NumPy 1.14.3
openCV 3.4.3
Camelot 0.3.2
Please help resolve this issue.
Adding both the "bin" and "lib" paths for Ghostscript to the PATH worked for me:
C:\Program Files\gs\gs9.26\bin
C:\Program Files\gs\gs9.26\lib
I unistalled the 64bit and
Install the 32bit version
Add the following two paths on Windows Environment Variables:
C:\Program Files(x86)\gs\gs9.26\bin
C:\Program Files(x86)\gs\gs9.26\lib
and now it works
Download Ghostscript from here https://www.ghostscript.com/download/gsdnld.html and add it to the path if required
For me using brew link -f --overwrite ghostscript solved the issue.
I would recommend checking the suggested solutions on https://github.com/atlanhq/camelot/issues/282. That's where I also found my fix.
Tried all the solutions. The only option that works is to use 32 bit ghostscript.
I had the same problem. I solved it by uninstalling the 64 bit version and installing the 32 bit version.
I realized that. If you are using the Python 64bit you need install ghostcript64 bit, else 32 bit.
Also set path for 64bit:
C:\Program Files\gs\gs9.26\bin
C:\Program Files\gs\gs9.26\lib
or for below for 32bit
C:\Program Files(x86)\gs\gs9.26\bin
C:\Program Files(x86)\gs\gs9.26\lib
Here is my solution (Windows OS (11, 64 BIT)):
Download and install the desired ghost version you wish (32,64 - does not matter)
Using "dir /x" command, get the short version of the path of your installation (c:\progra~1\blahbla...). My location (I love altering the default suggestion) is "C:\Program Files\gs\GPLGhostScript" and the short name is "c:\progra~1\gs\GPLGhostScript"
Add this to the path together with \bin. In my case "c:\progra~1\gs\GPLGhostScript\bin" (no need for lib path as suggested by others)
Restart your PC
Test your installation of GhostScript according to this link.
Good luck :)
This worked for me:
C:\Program Files\gs\gs9.55.0\bin
Just find the path location, copy it, and paste it into user and system variables Path (Environment variables).
I solved this problem.
I downloaded Ghostscript.
Then installed it at C:/programfiles.
Added set path: C:\Program Files\gs\gs9.26\bin + C:\Program Files\gs\gs9.26\lib
Restarted my computer.
After these steps, it worked.
A very simple way is to install Ghostscript from the official website.
Then give the location while set-up the library in the Anaconda script folder. Wait for 10 minutes after closing the Python platforms.
I was facing same issue for 2 days. I found solution at below link.
for windows 10, I used below method
in "search the web and windows" write "under edit environment variable for your account in control panel."
edit path for lib and bin library of Ghostscript here. add ; to separate the path at end also.
set path in environment variable
For more info used below link. It worked fine for me.
https://github.com/atlanhq/camelot/issues/465#issuecomment-975976344
For me, uninstalling camelot and re-installing with
conda install -c conda-forge camelot-py instead of pip solved the problem (as ghostscript is also re-installed)
In case you are fed up with all the errors derived from the usage of Ghostscript and want to find a way to use Camelot without using Ghostscript, here is the fork of it which does not rely on it.
Camelot fork without Ghostscript
Installation guide is similar, but this time from the github repo itself.
First, install these dependencies:
!pip install pdf2image
!pip install python-dateutil
!apt-get install poppler-utils
Then clone the repo
$ git clone https://www.github.com/h2oai/camelot
Finally, go to the repo directory and install camelot from there.
$ cd camelot
$ pip install ".[base]"
Import camelot and happily use it :)
This is how I solved for this error on a Windows computer, similar to what Alexander Garzo posted:
Went to File Explorer -> C drive -> Program Files -> gs -> gs9.55.0 -> shift-clicked on bin folder -> copied as path ("C:\Program Files\gs\gs9.55.0\bin")
Then went to environmental variables -> Path -> Edit -> New -> pasted above -> OK -> restarted computer.
I then ran the following code in Python:
import ctypes
from ctypes.util import find_library
find_library("".join(("gsdll", str(ctypes.sizeof(ctypes.c_voidp) * 8), ".dll")))
The output was "C:\Program Files\gs\gs9.55.0\bin\gsdll64.dll" which means the solution worked. I was then able to install and use Camelot with no problems.
I was getting this Error (OSError: Ghostscript is not installed. You can install it using the instructions here: https://camelot-py.readthedocs.io/en/master/user/install-deps.html)
I tried everything mentioned here and also in Github.
but after installing Ghostscript from here and then adding to the PATH.
I keep trying methods to solve it.
BUT the solution is to just Restart your computer and everything Works.
so Restart is Must.
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.
I'm using ubuntu x64, after two days and searching all the net, still i've not been able to install Megam,
i've read all information in this page http://www.cs.utah.edu/~hal/megam/
and installed x64 version of o'calm from http://packages.ubuntu.com/precise/ocaml
but when i want to use "megam" as a classifier in python, it says:
"NLTK was unable to find the megam file! Use software specific
configuration paramaters or set the MEGAM environment variable.
could anybody tell me how can i install and make use of it in python?
i've downloaded "ocaml-3.12.1.tar.gz" but the "make" command doesn't work (as it's said in its readme).
i've downloaded "megam_i686.opt" too, but it's not executable and i cannot run it
any help?
thanks in advance
For the future users:
megam is now available on MAC through brew:
$brew tap homebrew/science
$brew install megam
Use config_megam() to tell NLTK where the Megam executable is located. See: http://nltk.googlecode.com/svn/trunk/doc/api/nltk.classify.megam-module.html for details and documentation.
You also need to build MEGAM with the right 32/64 bit setting for your system. "megam_i686.opt" is for x86 iirc, so you should compile it for 64 bit. It is a while since I did this, but a simple build on an x64 system was all I needed: "Make doesn't work" is not very useful: I'm sure it gave you a few error messages...? Probably paths not set or are read only?
Edit: Looks like the above link is currently broken. The main Megam site can be found at:
http://www.umiacs.umd.edu/~hal/megam/
although it hasn't been updated for a while.
Answer given by Hugh Perkins, helped me resolve the issue (due to low reputation can't add a comment to that answer). After downloading the zip file (from http://thinknook.com/wp-content/uploads/2012/11/MEGAM.zip), I needed to tell python where it was, and that was done by adding it in os.environ as:
os.environ["MEGAM"] = '<<Complete path followed by file name>>/megam-64'
I downloaded from http://thinknook.com/wp-content/uploads/2012/11/MEGAM.zip , which was linked from http://thinknook.com/nltk-megam-maximum-entropy-library-on-64-bit-linux-2012-11-27/ This worked ok for me, on ubuntu 14.04
I manged to get megam to run on my docker instance running debian 9.7 following the steps below. Based on steps for MacOS install steps suggested by Jack Hong here.
apt-get install make
apt-get install ocaml-nox (or apt-get install ocaml, if you want x window support)
download source from here
unzip source creating a megam_0.92 directory
Edit the Makefile in megam_0.92 and make the following changes. (The
first change was already done in my particular instance):
WITHCLIBS=-I /usr/local/lib/ocaml/caml
WITHSTR =str.cma -cclib -lcamlstr
Save the changes and run make inside your megam_0.92 directory
add nltk.config_megam('//megam_0.92/megam') to your script and all should be well.