Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building wheel for dubins (setup.py) ... error #16

Open
fzdm2005 opened this issue Apr 21, 2021 · 12 comments
Open

Building wheel for dubins (setup.py) ... error #16

fzdm2005 opened this issue Apr 21, 2021 · 12 comments

Comments

@fzdm2005
Copy link

C:\Users\Administrator>pip install C:\dubins-1.0.1.tar
Processing c:\dubins-1.0.1.tar
Building wheels for collected packages: dubins
Building wheel for dubins (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\administrator\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Administrator\AppData\Local\Temp\pip-req-build-skffgh_w\setup.py'"'"'; file='"'"'C:\Users\Administrator\AppData\Local\Temp\pip-req-build-skffgh_w\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Administrator\AppData\Local\Temp\pip-wheel-uy59qlsk'
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-req-build-skffgh_w
Complete output (16 lines):
running bdist_wheel
running build
running build_ext
skipping 'dubins\dubins.c' Cython extension (up-to-date)
building 'dubins' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\dubins
creating build\temp.win-amd64-3.7\Release\dubins\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Idubins/include -Ic:\users\administrator\appdata\local\programs\python\python37\include -Ic:\users\administrator\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcdubins/src/dubins.c /Fobuild\temp.win-amd64-3.7\Release\dubins/src/dubins.obj
dubins.c
dubins/src/dubins.c(76): error C2065: “M_PI”: 未声明的标识符
dubins/src/dubins.c(385): error C2065: “M_PI”: 未声明的标识符
dubins/src/dubins.c(400): error C2065: “M_PI”: 未声明的标识符
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit status 2

ERROR: Failed building wheel for dubins
Running setup.py clean for dubins
Failed to build dubins
Installing collected packages: dubins
Running setup.py install for dubins ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\administrator\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Administrator\AppData\Local\Temp\pip-req-build-skffgh_w\setup.py'"'"'; file='"'"'C:\Users\Administrator\AppData\Local\Temp\pip-req-build-skffgh_w\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Administrator\AppData\Local\Temp\pip-record-d30bjoao\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\administrator\appdata\local\programs\python\python37\Include\dubins'
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-req-build-skffgh_w
Complete output (16 lines):
running install
running build
running build_ext
skipping 'dubins\dubins.c' Cython extension (up-to-date)
building 'dubins' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\dubins
creating build\temp.win-amd64-3.7\Release\dubins\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Idubins/include -Ic:\users\administrator\appdata\local\programs\python\python37\include -Ic:\users\administrator\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcdubins/src/dubins.c /Fobuild\temp.win-amd64-3.7\Release\dubins/src/dubins.obj
dubins.c
dubins/src/dubins.c(76): error C2065: “M_PI”: undeclared identifier
dubins/src/dubins.c(385): error C2065: “M_PI”: undeclared identifier
dubins/src/dubins.c(400): error C2065: “M_PI”: undeclared identifier
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\administrator\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Administrator\AppData\Local\Temp\pip-req-build-skffgh_w\setup.py'"'"'; file='"'"'C:\Users\Administrator\AppData\Local\Temp\pip-req-build-skffgh_w\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Administrator\AppData\Local\Temp\pip-record-d30bjoao\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\administrator\appdata\local\programs\python\python37\Include\dubins' Check the logs for full command output.

@rallen10
Copy link

rallen10 commented Dec 6, 2021

@fzdm2005 did you ever get a resolution for this? I just ran into the same problem

Edit: nevermind, it seems that my error was slightly different but also occurred when trying to pip install dubins. My error ended up being:

 dubins/dubins.c: In function ‘PyInit_dubins’:
    dubins/dubins.c:4497:34: error: ‘PyTypeObject {aka struct _typeobject}’ has no member named ‘tp_print’; did you mean ‘tp_dict’?
       __pyx_type_6dubins__DubinsPath.tp_print = 0;
                                      ^~~~~~~~
                                      tp_dict
    dubins/dubins.c:4502:54: error: ‘PyTypeObject {aka struct _typeobject}’ has no member named ‘tp_print’; did you mean ‘tp_dict’?
       __pyx_type_6dubins___pyx_scope_struct__sample_many.tp_print = 0;
                                                          ^~~~~~~~
                                                          tp_dict

To workaround my error, I downgraded my python from 3.9 to 3.8. Related thread here: https://bugzilla.redhat.com/show_bug.cgi?id=1791745

@rdesc
Copy link

rdesc commented May 26, 2022

An alternative solution is to install the package from source if you want to avoid downgrading python, i.e.

  1. clone - git clone https://github.com/AndrewWalker/pydubins
  2. remove the cython generated dubins.c file - rm dubins/dubins.c
  3. build - python setup.py build_ext --inplace
  4. Install with pip - pip install .

@nivolog
Copy link

nivolog commented Mar 10, 2023

@rdesc
Hello! How to use package after I installed it using your instrcutions? Simple "import dubins" don't work

Edit: Just figured it out. All you need is to append your path to dubins package

import sys
sys.path.append("###path to dubins package###")
import dubins

@rdesc
Copy link

rdesc commented Oct 25, 2023

As an update. I tried to make this work with python 3.9 and came across the following error

Error compiling Cython file:
------------------------------------------------------------
...
        ts = []
        def f(q, t):
            qs.append(q)
            ts.append(t)
            return 0
        core.dubins_path_sample_many(self.ppth, step_size, callback, <void*>f)
                                                           ^
------------------------------------------------------------

dubins/dubins.pyx:123:59: Cannot assign type 'int (double *, double, void *) except? -1' to 'DubinsPathSamplingCallback'. Exception values are incompatible. Suggest adding 'noexcept' to type 'int (double *, double, void *) except? -1'.

Simple fix is change this line

ctypedef int (*DubinsPathSamplingCallback)(double q[3], double t, void* user_data)

To the following:

    ctypedef int (*DubinsPathSamplingCallback)(double q[3], double t, void* user_data) except? -1

And then building with cython python setup.py build_ext --inplace should work fine

@rdesc
Copy link

rdesc commented Apr 3, 2024

Forked the repo with a working binary for Python 3.9 https://github.com/rdesc/pydubins

Should be able to install with 1 command now

pip install git+https://github.com/rdesc/pydubins.git

@kostaskonkk
Copy link

kostaskonkk commented Apr 24, 2024

I have tested the fork of @rdesc and it works also with python3.10 and python3.11. I have not tested python3.12

@AndrewWalker would it be a good idea to merge @rdesc fork into this repo so newer python versions are supported?

@rdesc
Copy link

rdesc commented Apr 24, 2024

Oh nice, thats good to hear! I'll update the readme on the fork. I don't think the owner of this repo is responsive.

@Chuanlong-Zang
Copy link

@rdesc Thanks for your fork! It works for me using Python 3.10. Is it possible to publish the new package to pip somehow?

@rdesc
Copy link

rdesc commented May 29, 2024

Great! Hmm that's a good idea actually. Then we could even merge some of the other fixes people have found. Maybe we could call it dubins2 or something.

@CAI006
Copy link

CAI006 commented Jul 21, 2024

image
a little weird

@rdesc
Copy link

rdesc commented Jul 21, 2024

@CAI006 hmm I haven't tried this in Windows but it seems like the error is coming from Microsoft visual studio from the screenshot ?

@rdesc
Copy link

rdesc commented Jul 21, 2024

@CAI006 also, take a look here #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants