Cannot find iio | ModuleNotFoundError: No module named 'iio'

Hi,

I followed https://wiki.analog.com/resources/tools-software/linux-software/pyadi-iio#support to install pyadi iio.

I did the following on Windows 10:

pip install pyadi-iio

Installed libiio using installer : https://wiki.analog.com/resources/tools-software/linux-software/libiio

and trying following code:

import adi
import numpy as np
import sys
try:
import iio
except:
# By default the iio python bindings are not in path
sys.path.append('C:/Python3/Lib/site-packages')
import iio
sdr = adi.ad9361()
data = np.arange(1, 10, 3)
# Send
sdr.tx(data)
# Receive
data_rx = sdr.rx()

I also tried :

pip install libiio

Following is error:
C:\WINDOWS\system32>pip install iio
Collecting iio
Using cached iio-0.0.3.tar.gz (39 kB)
Building wheels for collected packages: iio
Building wheel for iio (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\swaraj\\AppData\\Local\\Temp\\pip-install-a68jgq5p\\iio\\setup.py'"'"'; __file__='"'"'C:\\Users\\swaraj\\AppData\\Local\\Temp\\pip-install-a68jgq5p\\iio\\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\swaraj\AppData\Local\Temp\pip-wheel-9u6snd5n'
cwd: C:\Users\swaraj\AppData\Local\Temp\pip-install-a68jgq5p\iio\
Complete output (15 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.8
copying iio.py -> build\lib.win32-3.8
running build_ext
building 'libiio' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\iio
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iiio -Ic:\python3\include -Ic:\python3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tciio/iio.c /Fobuild\temp.win32-3.8\Release\iio/iio.obj
iio.c
iio/iio.c(175): fatal error C1083: Cannot open include file: 'libgen.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for iio
Running setup.py clean for iio
Failed to build iio
Installing collected packages: iio
Running setup.py install for iio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\swaraj\\AppData\\Local\\Temp\\pip-install-a68jgq5p\\iio\\setup.py'"'"'; __file__='"'"'C:\\Users\\swaraj\\AppData\\Local\\Temp\\pip-install-a68jgq5p\\iio\\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\swaraj\AppData\Local\Temp\pip-record-ikux4b2t\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python3\Include\iio'
cwd: C:\Users\swaraj\AppData\Local\Temp\pip-install-a68jgq5p\iio\
Complete output (15 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
copying iio.py -> build\lib.win32-3.8
running build_ext
building 'libiio' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\iio
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iiio -Ic:\python3\include -Ic:\python3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tciio/iio.c /Fobuild\temp.win32-3.8\Release\iio/iio.obj
iio.c
iio/iio.c(175): fatal error C1083: Cannot open include file: 'libgen.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\swaraj\\AppData\\Local\\Temp\\pip-install-a68jgq5p\\iio\\setup.py'"'"'; __file__='"'"'C:\\Users\\swaraj\\AppData\\Local\\Temp\\pip-install-a68jgq5p\\iio\\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\swaraj\AppData\Local\Temp\pip-record-ikux4b2t\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python3\Include\iio' Check the logs for full command output.



This is on Windows, added windows
[edited by: swaraj_chavan at 3:33 PM (GMT 0) on 20 Jul 2020]

Top Replies