You are not logged in.
update to 3.0.8 did the trick!
thanks!
(Moderator comment [ewaller] Merged threads)
Hello
I have a problem with python3 and a script in which I have to import the polygon module. Idle says " ImportError: No module named 'polygon' ".
I have then downloaded Polygon3 from " https://www.j-raedler.de/projects/polygon/ ", unzipped the file, went into the new folder (home/beuk/Polygon3-3.0.7) and then I ran:
" python setup.py build " and " python setup.py install ".
But I still have the same error:
>>> import polygon
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import polygon
ImportError: No module named 'polygon'
>>> import Polygon3
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import Polygon3
I don't know what to do anymore ... Can someone help me please? Thanks!
fagus
Last edited by fagus (2016-11-02 18:24:40)
Offline
Stand on the shoulders of giants.
aur/python-polygon 3.0.7-1 (1, 0.00)
Python package that handles polygonal shapes in 2D
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Thanks!
But it seems the package doesn't compile ...
error: command 'gcc' failed with exit status 1
==> ERROR: A failure occurred in package().
Aborting...
I'll make a new post on this.
Thanks anyway
fagus
Offline
Moderator comment [ewaller]: This message had been the start of a separate thread that was merged with the original thread
hello
I've tried to install the package python-polygon 3.0.7 from AUR, but when I run makepkg -sci I get following error-message:
" error: command 'gcc' failed with exit status 1 "
I have gcc installed though: the version is gcc 6.2.1 .
Can someone help me?
Thanks
fagus
Last edited by ewaller (2016-11-02 14:10:29)
Offline
That error message is not helping. Please post the complete output from first to last line. (use BB code)
You could also try to install that package using pip
https://packaging.python.org/installing/
Offline
Have you tried this already?
Please fix the PKGBUILD, here a working one: http://pastebin.com/AcRB77wa
Offline
thanks!
pip and fix I still have to try, but the complete output is:
[usr@arch builds]$ ls
python-polygon python-polygon.tar.gz
[beuk@archbeuk builds]$ cd python-polygon
[beuk@archbeuk python-polygon]$ makepkg -sci
==> Making package: python-polygon 3.0.7-1 (Wed Nov 2 11:41:36 CET 2016)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading Polygon3-3.0.7.zip...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 76193 100 76193 0 0 20973 0 0:00:03 0:00:03 --:--:-- 42142
==> Validating source files with md5sums...
Polygon3-3.0.7.zip ... Passed
==> Extracting sources...
-> Extracting Polygon3-3.0.7.zip with bsdtar
==> Starting prepare()...
==> Entering fakeroot environment...
==> Starting package()...
Using NumPy extension!
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/Polygon
copying Polygon/__init__.py -> build/lib.linux-x86_64-3.5/Polygon
copying Polygon/IO.py -> build/lib.linux-x86_64-3.5/Polygon
copying Polygon/Shapes.py -> build/lib.linux-x86_64-3.5/Polygon
copying Polygon/Utils.py -> build/lib.linux-x86_64-3.5/Polygon
running build_ext
building 'Polygon.cPolygon' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -DDEFAULT_STYLE=STYLE_LIST -DWITH_NUMPY=1 -Isrc -I/usr/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -c src/gpc.c -o build/temp.linux-x86_64-3.5/src/gpc.o
src/gpc.c: In function 'gpc_read_polygon':
src/gpc.c:1037:3: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf(fp, "%d", &(p->num_contours));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:1044:5: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf(fp, "%d", &(p->contour[c].num_vertices));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:1047:7: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf(fp, "%d", &(p->hole[c]));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:1054:7: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf(fp, "%lf %lf", &(p->contour[c].vertex[v].x),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&(p->contour[c].vertex[v].y));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c: In function 'gpc_polygon_clip':
src/gpc.c:1471:7: warning: 'dy' may be used uninitialized in this function [-Wmaybe-uninitialized]
build_intersection_table(&it, aet, dy);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:1672:12: warning: 'yt' may be used uninitialized in this function [-Wmaybe-uninitialized]
if ((edge->top.y == yt) && succ_edge)
^
src/gpc.c:1133:38: warning: 'tr' may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1133:34: warning: 'tl' may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1133:30: warning: 'br' may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1328:50: warning: 'bl' may be used uninitialized in this function [-Wmaybe-uninitialized]
vclass= tr + (tl << 1) + (br << 2) + (bl << 3);
~~~~^~~~~
src/gpc.c:1330:12: warning: 'contributing' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (contributing)
^
src/gpc.c: In function 'gpc_tristrip_clip':
src/gpc.c:2131:7: warning: 'dy' may be used uninitialized in this function [-Wmaybe-uninitialized]
build_intersection_table(&it, aet, dy);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:2361:12: warning: 'yt' may be used uninitialized in this function [-Wmaybe-uninitialized]
if ((edge->top.y == yt) && succ_edge)
^
src/gpc.c:1794:38: warning: 'tr' may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1794:34: warning: 'tl' may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1794:30: warning: 'br' may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1981:50: warning: 'bl' may be used uninitialized in this function [-Wmaybe-uninitialized]
vclass= tr + (tl << 1) + (br << 2) + (bl << 3);
~~~~^~~~~
src/gpc.c:1983:12: warning: 'contributing' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (contributing)
^
src/gpc.c:2062:16: warning: 'cft' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (cft == LED)
^
src/gpc.c:2064:26: warning: 'cf' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (cf->bot.y == yb)
~~~~~~~^~
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -DDEFAULT_STYLE=STYLE_LIST -DWITH_NUMPY=1 -Isrc -I/usr/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -c src/cPolygon.c -o build/temp.linux-x86_64-3.5/src/cPolygon.o
src/cPolygon.c:72:83: fatal error: /usr/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h: No such file or directory
#include </usr/lib/python3.4/site-packages/numpy/core/include/numpy/arrayobject.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
==> ERROR: A failure occurred in package().
Aborting...
[usr@arch python-polygon]$
-- mod edit: fixed ridiculous color tags. Trilby --
Offline
That PKGBUILD is outdated -- python 3.4 isn't in the repositories anymore. You will need to update it. See the comments on the package's page. Please also use code tags when pasting terminal output.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
So you added tags as requested, but instead of code, you used color? Please do not do that. Not only does it not get the formatting of code tags which is desired, but instead you make everything a color that is nearly impossible to read on some of the forums built-in themes.
I edited it for you this time.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
That PKGBUILD is outdated
Meanwhile it was updated to 3.0.8, works for me...
Offline
Presumably because I flagged it out of date, and the maintainer got notified.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
ewaller@turing ~ 1005 %cd devel/build
ewaller@turing ~/devel/build 1006 %git clone http://aur.archlinux.org/python-polygon
Cloning into 'python-polygon'...
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 9 (delta 2), reused 4 (delta 1)
Unpacking objects: 100% (9/9), done.
ewaller@turing ~/devel/build 1007 %cd python-polygon
ewaller@turing ~/devel/build/python-polygon 1008 %makepkg
==> Making package: python-polygon 3.0.8-1 (Wed Nov 2 06:53:04 PDT 2016)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading Polygon3-3.0.8.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 71446 100 71446 0 0 34917 0 0:00:02 0:00:02 --:--:-- 86496
==> Validating source files with md5sums...
Polygon3-3.0.8.tar.gz ... Passed
==> Extracting sources...
-> Extracting Polygon3-3.0.8.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
Using NumPy extension!
running build
running build_py [60/728]
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/Polygon
copying Polygon/IO.py -> build/lib.linux-x86_64-3.5/Polygon
copying Polygon/Shapes.py -> build/lib.linux-x86_64-3.5/Polygon
copying Polygon/Utils.py -> build/lib.linux-x86_64-3.5/Polygon
copying Polygon/__init__.py -> build/lib.linux-x86_64-3.5/Polygon
running build_ext
building 'Polygon.cPolygon' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -DDEFAULT_STYLE=STYLE_LIST -DWITH_NUMPY=1 -Isrc -I/usr/lib/python3.5/site-packages/n
umpy/core/include -I/usr/include/python3.5m -c src/gpc.c -o build/temp.linux-x86_64-3.5/src/gpc.o
src/gpc.c: In function ‘gpc_read_polygon’:
src/gpc.c:1037:3: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
fscanf(fp, "%d", &(p->num_contours));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:1044:5: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
fscanf(fp, "%d", &(p->contour[c].num_vertices));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:1047:7: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
fscanf(fp, "%d", &(p->hole[c]));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:1054:7: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
fscanf(fp, "%lf %lf", &(p->contour[c].vertex[v].x),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&(p->contour[c].vertex[v].y));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c: In function ‘gpc_polygon_clip’:
src/gpc.c:1471:7: warning: ‘dy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
build_intersection_table(&it, aet, dy);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:1672:12: warning: ‘yt’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if ((edge->top.y == yt) && succ_edge)
^
src/gpc.c:1133:38: warning: ‘tr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1133:34: warning: ‘tl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1133:30: warning: ‘br’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1328:50: warning: ‘bl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
vclass= tr + (tl << 1) + (br << 2) + (bl << 3);
~~~~^~~~~
src/gpc.c:1330:12: warning: ‘contributing’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (contributing)
^
src/gpc.c: In function ‘gpc_tristrip_clip’:
src/gpc.c:2131:7: warning: ‘dy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
build_intersection_table(&it, aet, dy);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gpc.c:2361:12: warning: ‘yt’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if ((edge->top.y == yt) && succ_edge)
^
src/gpc.c:1794:38: warning: ‘tr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1794:34: warning: ‘tl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
^~
src/gpc.c:1794:30: warning: ‘br’ may be used uninitialized in this function [-Wmaybe-uninitialized]
int vclass, bl, br, tl, tr;
^~
src/gpc.c:1981:50: warning: ‘bl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
vclass= tr + (tl << 1) + (br << 2) + (bl << 3);
~~~~^~~~~
src/gpc.c:1983:12: warning: ‘contributing’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (contributing)
^
src/gpc.c:2062:16: warning: ‘cft’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (cft == LED)
^
src/gpc.c:2064:26: warning: ‘cf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (cf->bot.y == yb)
~~~~~~~^~
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -DDEFAULT_STYLE=STYLE_LIST -DWITH_NUMPY=1 -Isrc -I/usr/lib/python3.5/site-packages/n
umpy/core/include -I/usr/include/python3.5m -c src/cPolygon.c -o build/temp.linux-x86_64-3.5/src/cPolygon.o
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -DDEFAULT_STYLE=STYLE_LIST -DWITH_NUMPY=1 -Isrc -I/usr/lib/python3.5/site-packages/n
umpy/core/include -I/usr/include/python3.5m -c src/PolyUtil.c -o build/temp.linux-x86_64-3.5/src/PolyUtil.o
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1,--sort-common,--as-needed,-z,relro -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 bui
ld/temp.linux-x86_64-3.5/src/gpc.o build/temp.linux-x86_64-3.5/src/cPolygon.o build/temp.linux-x86_64-3.5/src/PolyUtil.o -L/usr/lib -lpython3.5m -o build/lib.linux-x86_64-3.5/Polygon/cPolygon.cpython-35m-x86_64-linux-gnu.so
==> Entering fakeroot environment...
==> Starting package()...
Using NumPy extension!
running install
running build
running build_py
running build_ext
running install_lib
creating /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr
creating /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib
creating /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5
creating /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages
creating /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon
copying build/lib.linux-x86_64-3.5/Polygon/IO.py -> /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon
copying build/lib.linux-x86_64-3.5/Polygon/Shapes.py -> /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon
copying build/lib.linux-x86_64-3.5/Polygon/Utils.py -> /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon
copying build/lib.linux-x86_64-3.5/Polygon/__init__.py -> /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon
copying build/lib.linux-x86_64-3.5/Polygon/cPolygon.cpython-35m-x86_64-linux-gnu.so -> /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon
byte-compiling /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon/IO.py to IO.cpython-35.pyc
byte-compiling /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon/Shapes.py to Shapes.cpython-35.pyc
byte-compiling /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon/Utils.py to Utils.cpython-35.pyc
byte-compiling /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon/__init__.py to __init__.cpython-35.pyc
running install_egg_info
Writing /home/ewaller/devel/build/python-polygon/pkg/python-polygon/usr/lib/python3.5/site-packages/Polygon3-3.0.8-py3.5.egg-info
==> Tidying install...
-> Removing libtool files...
-> Purging unwanted files...
-> Removing static library files...
-> Stripping unneeded symbols from binaries and libraries...
-> Compressing man and info pages...
==> Checking for packaging issue...
==> Creating package "python-polygon"...
-> Generating .PKGINFO file...
-> Generating .BUILDINFO file...
-> Generating .MTREE file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: python-polygon 3.0.8-1 (Wed Nov 2 06:53:24 PDT 2016)
ewaller@turing ~/devel/build/python-polygon 1009 %
Edit: This post had been a response to the original thread.
fagus, please do not open multiple threads on a topic. In this case, it was not a complete cross post; never-the-less, it is best to keep the entire problem in one place. In the future, if the scope of a problem changes and you would like a thread to be moved, please, just ask using the report link of the thread. A moderator will be happy to move it -- and there are usually one of us around. Thanks,.
Last edited by ewaller (2016-11-02 14:11:27)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
It also appears that it cannot find the numpy headers, but it does appear that python-numpy is listed as a dependency. It should be installed, but if it had been installed for a different Python version, it could be that the headers are in the wrong spot. Try reinstalling python-numpy.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline