Not able to build syntaxNet source? - python

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 :)

Related

xfoil for python package installation issues "UserWarning: Unknown distribution option: 'zip_save'"

On my laptop Windows 10 machine I was able to download the package "xfoil 1.1.1": https://pypi.org/project/xfoil/ in Jupyter Notebook by executing the command "!pip install xfoil". I tried doing the exact same thing on my new desktop and get the error "ERROR: Failed building wheel for xfoil" as well as the warning "UserWarning: Unknown distribution option: 'zip_save'". This is the same error described here: https://www.pythonanywhere.com/forums/topic/27038/ even though I have no issues installing other packages. The conclusion from that thread seemed to be that the package must have an error associated with it, but I am not sure why it would work on one machine but not the other since I am using Anaconda 3.8 for both.
It's a bug in the package: zip_save is misspelled, it must be spelled zip_safe. You cannot do much with it until the author(s) fix the bug.
You can fork the repository, fix the misspelling and install the package from your own repository.
Download the files from here.
On your command line type: python setup.py install
If you get this error:
ValueError: Unknown MS Compiler version 1927
go to
C:\Python39\Lib\distutils
and locate the file: cygwinccompiler.py
In the function
def get_msvcr():
add one more "elif" statement like this one:
elif msc_ver == '1927':
return ["mspdb140.dll"]

When I tried to install sacrebleu, I got an installation error

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.

How to compile TeX file from Python

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.

Compile errors trying to install WebRTCVAD module

I'm trying to create an app that uses the WebRTC VAD code.
I have found this: https://pypi.python.org/pypi/webrtcvad
The issue is that I cannot get it to work.
I extract the content into a folder but when It ry to run something it complains that _webrtcvad module is missing.
After a little research I tried to install the webRTC VAD module through pip. When doing this inside the folder I extracted into I get this:
When trying in another directory this happens:
How do I get this to work?
The problem was a bug in my webrtcvad's setup.py that caused it to use the wrong flags when compiling for Windows: it was using -DWEBRTC_POSIX instead of -DWIN32.
The fixed version has been pushed to pypi as version 2.0.9. I've confirmed that pip install webrtcvad works correctly on Windows 10.

Fatal Python error after Scipy Superpack installation (Mac)

Instead of using a Python distribution, I decided to install Scipy myself and stumbled upon Scipy Superpack (http://fonnesbeck.github.io/ScipySuperpack/). After installing Python 2.7.6 I followed the instructions on the website and everything seemed to work without any problems. However, once the installation was done I received a "fatal error" message as I tried to look through my modules. More specifically, the following error:
>>> help('modules')
Please wait a moment while I gather a list of all available modules...
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
I receive the same error message in the terminal, as well as through IDLE. Despite the error message, I am able to import and use numpy, as well as other modules from the superpack.
I should mention that prior to installing the superpack I installed pip. However, this didn't induce the previously mentioned error.
I am very new to osx, so any advice would be greatly appreciated!
I was also having a lot of problems while trying to install all the python libraries in my mac. I searched on the web for some hours and finally got something that worked out for me.
Scipy is here as well if you want to follow this rules instead:
https://gist.github.com/audy/4012573

Categories