[英]pip install pyswisseph giving error on windows 10
當我運行命令
pip install pyswisseph
安裝swiss ephemeris的python擴展名,它給出錯誤。
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>
不幸的是,切換到UNIX-y系統(例如Linux或macOS)(或者可能使用了基於GCC的工具鏈(例如Windows上的MinGW))。
該軟件包似乎與Windows / Visual Studio不兼容。 setup.py
文件充滿了僅在UNIXes上有意義的假設。
編輯:該程序包在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
最后弄清楚了如何使模塊在Windows中工作。 我們必須使用來自' https://www.lfd.uci.edu/~gohlke/pythonlibs/ '的非官方Windows二進制文件wheel文件。 不同版本的python和模塊更新有不同的方向盤。 我使用了:pyswisseph‑2.5.1.post0‑cp37‑cp37m‑win_amd64.whl。 使用適合您的python / windows版本的輪子解決方案:您所要做的就是打開命令窗口,鍵入'pip install pyswisseph‑2.5.1.post0‑cp37‑cp37m–win_amd64.whl',然后將其安裝。
運行pyswisseph軟件包的最簡單方法是使用免費的Google Colab平台在Ubuntu VM上使用它。 有關示例代碼,請單擊此鏈接 ,然后創建您自己的筆記本文件副本,它應該可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.