Closed Xzib closed 4 years ago
It feels you didn't download the Mercury API. Try to folllow the build instructions in README.
+1 unable to install the library using pip OS: ubuntu 18
The error also appears when xsltproc
is not installed. Please make sure you have all software required to build it (see the documentation):
sudo apt-get install unzip patch xsltproc gcc libreadline-dev python-dev python-setuptools
Another trap for young players: the installation will throw this error also if it runs out of space in /tmp
. I know the space requirement is mentioned in the installation instructions (very helpful, thank you!), but not being one to read such things too carefully (I know!) I was initially stumped by fatal error: tm_reader.h: No such file or directory
, and it took me a moment to find the true reason for it. The /tmp
in my case is a tmpfs
partition on a Pi3B, so nowhere near the required size. Installing with pip3 install python-mercuryapi -b /var/tmp
got around the error (with /var/tmp
being on disk microSD).
pip3 install python-mercuryapi -b /var/tmp still fails as well
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o5n00f6t/python-mercuryapi_6fcf76df24594a4eb2065aad8ac2c0ba/setup.py'"'"'; file='"'"'/tmp/pip-install-o5n00f6t/python-mercuryapi_6fcf76df24594a4eb2065aad8ac2c0ba/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-07ci9wp2/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.9/python-mercuryapi Check the logs for full command output.
Your formatting is terrible, but I think pip is trying to unzip a 404 page; https://www.jadaktech.com/wp-content/uploads/2019/10/mercuryapi-1.31.1.36-2.zip does not exist any more, so the installer is curling an 88kb HTML page into a file called mercuryapi-1.31.1.36-2.zip. That won't work.
As it stands I think installing via pip is a no-go, and you have to build manually instead. Grab the latest release at https://github.com/gotthardp/python-mercuryapi/archive/refs/tags/v0.5.3.tar.gz and untar it to a folder, then download the mercuryapi ZIP file separately and place it in the python-mercuryapi folder. Then edit the Makefile setting for APIZIP to the name of the ZIP-file you downloaded before building.
@clickworkorange , Is there a detailed order? I don't know exactly how to do it
@DoongLi
python-mercuryapi
folder. Makefile
setting for APIZIP
to match the name of the ZIP-file you downloaded.make
.sudo make install
10:42:29 |base|root@trixie python-mercuryapi-0.5.3 → make
unzip mercuryapi-1.31.1.36-2.zip
unzip: cannot find or open mercuryapi-1.31.1.36-2.zip, mercuryapi-1.31.1.36-2.zip.zip or mercuryapi-1.31.1.36-2.zip.ZIP.
make: *** [Makefile:23 : mercuryapi-1.31.1.36/.done] Erreur 9
I downloaded the tar and zip version 0.5.3, put the zip in the python-mercury api folder, edit the Make file like so :
...
$(APIZIP): python-mercuryapi-0.5.3.zip
edit: I didn't see the first 2 lines, so i changed them too like this
APIZIP ?= python-mercuryapi-0.5.3.zip
APIVER ?= 0.5.3
I say Replace All:
11:01:16 |base|root@trixie python-mercuryapi-0.5.3 → make
make: Dépendance circulaire python-mercuryapi-0.5.3.zip <- python-mercuryapi-0.5.3.zip abandonnée.
unzip python-mercuryapi-0.5.3.zip
Archive: python-mercuryapi-0.5.3.zip
ef5bff91acdb6f47855ea1446d1d942838a00ee6
replace python-mercuryapi-0.5.3/.gitignore? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
and it gives me :
extracting: python-mercuryapi-0.5.3/.gitignore
inflating: python-mercuryapi-0.5.3/.travis.yml
inflating: python-mercuryapi-0.5.3/LICENSE
inflating: python-mercuryapi-0.5.3/MANIFEST.in
inflating: python-mercuryapi-0.5.3/Makefile
inflating: python-mercuryapi-0.5.3/README.md
inflating: python-mercuryapi-0.5.3/long_description.txt
inflating: python-mercuryapi-0.5.3/mercury.c
inflating: python-mercuryapi-0.5.3/mercuryapi.patch
inflating: python-mercuryapi-0.5.3/mercuryapi.pyproj
inflating: python-mercuryapi-0.5.3/mercuryapi.sln
inflating: python-mercuryapi-0.5.3/mercuryapi_osx.patch
inflating: python-mercuryapi-0.5.3/setup-win.py
inflating: python-mercuryapi-0.5.3/setup.py
inflating: python-mercuryapi-0.5.3/test.py
patch -p0 -d mercuryapi-0.5.3 < mercuryapi.patch
patch: **** Can't change to directory mercuryapi-0.5.3 : No such file or directory
make: *** [Makefile:24 : mercuryapi-0.5.3/.done] Erreur 2
see the Can't change to directory mercuryapi-0.5.3 : No such file or directory
, so i change the name from python-mercuryapi-0.5.3
to mercuryapi-0.5.3
.
and now i have:
11:07:18 |base|root@trixie mercuryapi-0.5.3 → make
make: Dépendance circulaire mercuryapi-0.5.3.zip <- mercuryapi-0.5.3.zip abandonnée.
unzip mercuryapi-0.5.3.zip
Archive: mercuryapi-0.5.3.zip
ef5bff91acdb6f47855ea1446d1d942838a00ee6
creating: python-mercuryapi-0.5.3/
extracting: python-mercuryapi-0.5.3/.gitignore
inflating: python-mercuryapi-0.5.3/.travis.yml
inflating: python-mercuryapi-0.5.3/LICENSE
inflating: python-mercuryapi-0.5.3/MANIFEST.in
inflating: python-mercuryapi-0.5.3/Makefile
inflating: python-mercuryapi-0.5.3/README.md
inflating: python-mercuryapi-0.5.3/long_description.txt
inflating: python-mercuryapi-0.5.3/mercury.c
inflating: python-mercuryapi-0.5.3/mercuryapi.patch
inflating: python-mercuryapi-0.5.3/mercuryapi.pyproj
inflating: python-mercuryapi-0.5.3/mercuryapi.sln
inflating: python-mercuryapi-0.5.3/mercuryapi_osx.patch
inflating: python-mercuryapi-0.5.3/setup-win.py
inflating: python-mercuryapi-0.5.3/setup.py
inflating: python-mercuryapi-0.5.3/test.py
patch -p0 -d mercuryapi-0.5.3 < mercuryapi.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- c/src/api/Makefile 2015-10-06 04:39:20.000000000 -0700
|+++ c/src/api/Makefile 2016-07-30 02:44:13.854834003 -0700
--------------------------
I try all the steps before with $(APIZIP): ./mercuryapi-0.5.3
$(APIZIP): mercuryapi-0.5.3
or $(APIZIP): /home/$USER/mercuryapi-0.5.3/mercuryapi-0.5.3.zip
and the same on the first line with APIZIP ?= mercuryapi-0.5.3
, APIZIP ?= ./mercuryapi-0.5.3 or APIZIP ?= /home/$USER/mercuryapi-0.5.3
I also answer [A]ll or [N]one when asked
Sorry if it sound stupid, but it's the second time i ever do a make && make install ,
In the folder python-mercuryapi
(v0.5.4) I have the ZIP file mercuryapi-AHAB-1.35.2.72-1.zip
. In the Makefile
I have
APIZIP ?= mercuryapi-AHAB-1.35.2.72-1.zip
APIVER ?= 1.35.2.72
I open a terminal, cd
to python-mercuryapi
and type make
. This builds the project without errors. A few suggestions that may help:
python-mercuryapi
(v0.5.4) by typing git clone https://github.com/gotthardp/python-mercuryapi
. You shouldn't need to make any changes to the Makefile
.mercuryapi-AHAB-1.35.2.72-1.zip
to the folder created by the previous command. You can get this from https://www.jadaktech.com/documents-downloads/thingmagic-mercury-api-firmware-v1-35-2 (registration required). Makefile
to match your filename and version. For example:
APIZIP ?= mercuryapi-1.31.4.35.zip
APIVER ?= 1.31.4.35
I have tested and confirmed that both v1.31.4.35 and v1.35.2.72 build correctly with the latest version of python-mercuryapi
(v0.5.4). There is a newer version available of Jadak's API, v1.37.2 which may also work, though I have not tested this.
HTH!
in #142 I mentioned that I'm successfully using api 1.37.2 (also check this PR #148 ) maybe you could try that version as well ... ?
ok, that was a dumb thing for me in fact,.. i was using the code and the zip from the realease page. If i clone the repo everything works out the box.
So the 'latest' was not really the 'LATEST'.
So if it helps. just clone the repo. Modification has been made there
While installing the library in windows, it is giving the following error
mercury.c:23:10: fatal error: tm_reader.h: No such file or directory
include