tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.06k stars 2.23k forks source link

install package on windows #998

Open hungrh-pj opened 9 years ago

hungrh-pj commented 9 years ago

Hi

after i installed "VCForPython27.msi" i run the command "python setup.py install" and i got

Installed c:\python27\lib\site-packages\yowsup2-2.3.185-py2.7.egg Processing dependencies for yowsup2==2.3.185 Searching for python-axolotl-curve25519 Reading https://pypi.python.org/simple/python-axolotl-curve25519/ Best match: python-axolotl-curve25519 0.1 Downloading https://pypi.python.org/packages/source/p/python-axolotl-curve25519/ python-axolotl-curve25519-0.1.tar.gz#md5=f28d902df9044f0bf86a35a4bd2ec092 Processing python-axolotl-curve25519-0.1.tar.gz Writing c:\users\ruohan\appdata\local\temp\easy_install-i_fuv2\python-axolotl-cu rve25519-0.1\setup.cfg Running python-axolotl-curve25519-0.1\setup.py -q bdist_egg --dist-dir c:\users\ ruohan\appdata\local\temp\easy_install-i_fuv2\python-axolotl-curve25519-0.1\egg- dist-tmp-myktge curve25519module.c curve25519module.c(76) : error C2143: syntax error : missing ';' before 'type' curve25519module.c(78) : error C2065: 'result' : undeclared identifier curve25519module.c(82) : error C2143: syntax error : missing '{' before '' curve25519module.c(100) : warning C4133: 'return' : incompatible types - from 'P yObject ' to 'int ' curve25519module.c(146) : warning C4133: 'initializing' : incompatible types - f rom 'int (__cdecl )(PyObject ,PyObject *)' to 'PyCFunction' error: Setup script exited with error: command 'C:\Users\RuoHan\AppData\Loca l\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' fai led with exit status 2

could you let me know if it will has an update or what do i need to do to complete the installation?

Thank you Regards Hung

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

srinarasi commented 9 years ago

I have the same problem. Win 10, Python 2.7.10 and have VCForPython27 installed.

antonio9213 commented 8 years ago

@hungrh That is a problem caused by MS C compiler not supporting C99. Source code of one of yowsup's dependences (python-axolotl-curve25519), uses variable definitions mixed with code, a feature introduced in C99 (in C89, variables should be defined at the begginning of the scope). To get rid of this problem without modifying that module's code, I will tell you what worked for me:

1.- Install Python 2.7.9 for Windows x32. I do not know if it works with Python 3 or the x64 versions, just know that it works well with 2.7.9 and that it does NOT work with 2.7.10.

2.- Download and install MinGW from http://sourceforge.net/projects/mingw/files/ (Select Installer, download the mingw-get setup package and follow instructions to install MinGW with MSYS and C compiler). We need it as the gcc included with MinGW supports C99.

3.- Navigate to C:\Python27\Lib\distutils (providing you installed Python in C:\Python27) and create a plain text file called distutils.cfg with the following content (two lines):

[build]
compiler=mingw32

4.- Download zlib for MinGW32 from http://sourceforge.net/projects/mingw/files/MinGW/Extension/zlib/zlib-1.2.7-1/ (pick the dev version) and copy the files to include and lib directories in your MinGW installation.

5.- Now go to your yowsup folder and attempt python setup.py install again, it should complete without problems.

janboll commented 8 years ago

Thank you @antonio9213 ! Looks like your text is worth updating README.md

hmrasi commented 6 years ago

Still getting the error regarding the axolotl curve25519. Can you help me resolving the issue?