Pystruct couldn't be installed??? Please help.

1,318 views
Skip to first unread message

lewis

unread,
Mar 11, 2016, 12:44:45 AM3/11/16
to pystruct
    Some installed packages and environment: numpy, scipy, cython, scikit-learn, Python 2.7.10 (Anaconda 2.4.0 64-bit), windows 7 64-bit
    I tried it many times to install it in windows cmd using "pip install pystruct", but there is error coming out each time, shown as [error 1]. It seems the error is caused by installing ad3? or by c++ compiler ? 
    Did anyone encounter this same problem? Really appreciate if some one could give me some suggestions. Really appreciate that!




[error 1] =======================================================================
C:\Users\username>pip install pystruct
Collecting pystruct
Collecting ad3 (from pystruct)
  Using cached ad3-2.0.2.tar.gz
Building wheels for collected packages: ad3
  Running setup.py bdist_wheel for ad3
  Complete output from command C:\Anaconda2\python.exe -c "import setuptools;__f
ile__='c:\\users\\username\\appdata\\local\\temp\\pip-build-ksu2no\\ad3\\setup.py';e
xec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdi
st_wheel -d c:\users\username\appdata\local\temp\tmpuqja6bpip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-2.7
  creating build\lib.win-amd64-2.7\ad3
  copying python\ad3\simple_inference.py -> build\lib.win-amd64-2.7\ad3
  copying python\ad3\__init__.py -> build\lib.win-amd64-2.7\ad3
  running build_clib
  building 'ad3' library
  creating build\temp.win-amd64-2.7
  creating build\temp.win-amd64-2.7\ad3
  C:\TDM-GCC-64\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -I. -I./ad3 -I./Eigen -c a
d3/FactorGraph.cpp -o build\temp.win-amd64-2.7\ad3\factorgraph.o
  ad3/FactorGraph.cpp:22:26: fatal error: gettimeofday.h: No such file or direct
ory
  compilation terminated.
  error: command 'C:\\TDM-GCC-64\\bin\\gcc.exe' failed with exit status 1

  ----------------------------------------
  Failed building wheel for ad3
Failed to build ad3
Installing collected packages: ad3, pystruct
  Running setup.py install for ad3
    Complete output from command C:\Anaconda2\python.exe -c "import setuptools,
tokenize;__file__='c:\\users\\username\\appdata\\local\\temp\\pip-build-ksu2no\\ad3\
\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace
('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\rliu\appdata\local
\temp\pip-hbb14o-record\install-record.txt --single-version-externally-managed -
-compile:
    running install
    running build
    running build_py
    running build_clib
    building 'ad3' library
    C:\TDM-GCC-64\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -I. -I./ad3 -I./Eigen -c
 ad3/FactorGraph.cpp -o build\temp.win-amd64-2.7\ad3\factorgraph.o
    ad3/FactorGraph.cpp:22:26: fatal error: gettimeofday.h: No such file or dire
ctory
    compilation terminated.
    error: command 'C:\\TDM-GCC-64\\bin\\gcc.exe' failed with exit status 1

    ----------------------------------------
Command "C:\Anaconda2\python.exe -c "import setuptools, tokenize;__file__='c:\\u
sers\\username\\appdata\\local\\temp\\pip-build-ksu2no\\ad3\\setup.py';exec(compile(
getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__
, 'exec'))" install --record c:\users\username\appdata\local\temp\pip-hbb14o-record\
install-record.txt --single-version-externally-managed --compile" failed with er
ror code 1 in c:\users\username\appdata\local\temp\pip-build-ksu2no\ad3
You are using pip version 7.1.2, however version 8.1.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.


 =======================================================================







Andreas Mueller

unread,
Mar 18, 2016, 4:18:00 AM3/18/16
to pyst...@googlegroups.com
This is a problem with installing the current ad3 that is on pypi on windows.
Please try installing pystruct without ad3. It is an optional dependency.
You can look at the ad3 master repo if you do want to install it.
--
You received this message because you are subscribed to the Google Groups "pystruct" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystruct+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shuyang Sheng

unread,
Mar 25, 2016, 12:23:51 AM3/25/16
to pystruct
Yes it is a problem caused by ad3. As Andreas mentioned, you can install pystruct without ad3, but if you absolutely need ad3, you'll need to download the ad3 code from the github repository, and compile it manually.

Unfortunately you may still find that ad3 may not be able to compile, if that happens, you can check out the following link:


I reported this issue a few months ago and it should be fixed by now. If not, you can check out your error message ( like this "ad3/FactorGraph.cpp:22:26: fatal error: gettimeofday.h: No such file or directory"), find the header file that cannot be found, and change its relative path as I described in the link.

Andreas Mueller

unread,
Mar 31, 2016, 10:58:17 AM3/31/16
to pyst...@googlegroups.com
If the current master in AD3 works, I should update the pip package.
Did you have any problems with the AD3 on github?

Shuyang Sheng

unread,
Mar 31, 2016, 4:18:58 PM3/31/16
to pyst...@googlegroups.com
The current master in AD3 is good, I downloaded and compiled it last week, no issue found.

You received this message because you are subscribed to a topic in the Google Groups "pystruct" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pystruct/tjNM1m1mmUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pystruct+u...@googlegroups.com.

ayşe bilge gündüz

unread,
Feb 14, 2018, 1:38:19 AM2/14/18
to pystruct
I have ad3 but I have same problem in macOSX.

Requirement already satisfied: ad3 in /usr/local/lib/python3.6/site-packages (from pystruct)

Building wheels for collected packages: pystruct

  Running setup.py bdist_wheel for pystruct ... error

.....

compilation terminated.

  error: command '/usr/local/bin/gcc-5' failed with exit status 1

  

  ----------------------------------------

  Failed building wheel for pystruct

....

JL Meunier

unread,
Feb 15, 2018, 7:12:05 AM2/15/18
to pystruct
Hi

Since ad3 is currently evolving, I checked installing latest version of ad3 and of pystruct from github (from their master branch).

So, using python2.7 on my win10 PC, and after installing the Microsoft C++ package that ad3 requested, things are working fine.

> git clone ....
> pip install install numpy scipy cvxopt pyqpbo scikit-learn nose pytest 
../ad3> python setup.py install
../pystruct> python setup.py install

In case it helps.

JL
Reply all
Reply to author
Forward
0 new messages