Reputation: 13
When I run the command
pip install pyswisseph
to install the python extension of the swiss ephemeris, its giving errors.
C:\WINDOWS\system32>pip install pyswisseph
Collecting pyswisseph
Using cached https://files.pythonhosted.org/packages/09/27/10ad652fa0e07fc89890142a6f900725e26cf02a24d8fd724015e08707b5/pyswisseph-2.00.00-2.tar.bz2
Building wheels for collected packages: pyswisseph
Running setup.py bdist_wheel for pyswisseph ... error
Complete output from command c:\users\narayana\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Narayana\\AppData\\Local\\Temp\\pip-install-wlypji8s\\pyswisseph\\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\Narayana\AppData\Local\Temp\pip-wheel-f31zjcrt --python-tag cp37:
Searching system libswe...
pkg-config not found
Using internal libswe
c:\users\narayana\appdata\local\programs\python\python37\lib\site-packages\setuptools\dist.py:398: UserWarning: Normalizing '2.00.00-2' to '2.0.0.post2'
normalized_version,
running bdist_wheel
running build
running build_ext
building 'swisseph' 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\libswe
creating build\temp.win-amd64-3.7\Release\swephelp
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ilibswe -Iswephelp -Ic:\users\narayana\appdata\local\programs\python\python37\include -Ic:\users\narayana\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\include" /Tcpyswisseph.c /Fobuild\temp.win-amd64-3.7\Release\pyswisseph.obj -std=gnu99
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
pyswisseph.c
c:\users\narayana\appdata\local\programs\python\python37\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
**----------------------------------------
Failed building wheel for pyswisseph**
Running setup.py clean for pyswisseph
Failed to build pyswisseph
Installing collected packages: pyswisseph
Running setup.py install for pyswisseph ... error
Complete output from command c:\users\narayana\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Narayana\\AppData\\Local\\Temp\\pip-install-wlypji8s\\pyswisseph\\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\Narayana\AppData\Local\Temp\pip-record-00ch1s58\install-record.txt --single-version-externally-managed --compile:
Searching system libswe...
pkg-config not found
Using internal libswe
c:\users\narayana\appdata\local\programs\python\python37\lib\site-packages\setuptools\dist.py:398: UserWarning: Normalizing '2.00.00-2' to '2.0.0.post2'
normalized_version,
running install
running build
running build_ext
building 'swisseph' 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\libswe
creating build\temp.win-amd64-3.7\Release\swephelp
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ilibswe -Iswephelp -Ic:\users\narayana\appdata\local\programs\python\python37\include -Ic:\users\narayana\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\include" /Tcpyswisseph.c /Fobuild\temp.win-amd64-3.7\Release\pyswisseph.obj -std=gnu99
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
pyswisseph.c
c:\users\narayana\appdata\local\programs\python\python37\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
**----------------------------------------
Command "c:\users\narayana\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Narayana\\AppData\\Local\\Temp\\pip-install-wlypji8s\\pyswisseph\\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\Narayana\AppData\Local\Temp\pip-record-00ch1s58\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Narayana\AppData\Local\Temp\pip-install-wlypji8s\pyswisseph\**
C:\WINDOWS\system32>
Upvotes: 0
Views: 2033
Reputation: 1149
The easiest way to run the pyswisseph package is to use it on an Ubuntu VM using the free Google Colab platform. For a sample code, please follow this link and then create your own copy of the notebook file and it should work.
Upvotes: 0
Reputation: 13
Finally figured out how to get the module working in windows. we have to use an unofficial windows binary , wheel file from ' https://www.lfd.uci.edu/~gohlke/pythonlibs/'. there are different wheel's for different versions of python and updates of the module. i used :pyswisseph‑2.5.1.post0‑cp37‑cp37m‑win_amd64.whl. use the wheel which suits your python/windows version Solution: all you have to do is open command window, type ' pip install pyswisseph‑2.5.1.post0‑cp37‑cp37m‑win_amd64.whl' and it gets installed.
Upvotes: 1
Reputation: 169042
Unfortunately, by switching to an UNIX-y system such as Linux or macOS (or maybe with a GCC-based toolchain like MinGW on Windows).
The package does not seem compatible with Windows/Visual Studio; the setup.py
file is chock full of assumptions that only make sense on UNIXes.
EDIT: The package works fine on macOS:
$ uname -a
Darwin xx 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64
$ pip install pyswisseph
Collecting pyswisseph
Downloading... (458kB)
Building wheels for collected packages: pyswisseph
Running setup.py bdist_wheel for pyswisseph ... done
Successfully built pyswisseph
Installing collected packages: pyswisseph
Successfully installed pyswisseph-2.0.0.post2
Upvotes: 1