install llvmlite and numba library for python2 on jetson xavier nx - python

I want to install numba and llvmlite for python2 on jetson. However there seems to be no documentation on the same. Everything is for python3. I am trying to run a program on ros melodic and hence need the libraries in python2.
When i try
python2.7 -m pip install numba==0.45
I am getting following error
Collecting numba==0.45
Downloading https://files.pythonhosted.org/packages/7e/89/853a1f03b09f1b13b59c3d785678b47daac6ddd24a285f146d09bb723b85/numba-0.45.0.tar.gz (1.8MB)
100% |████████████████████████████████| 1.8MB 328kB/s
Collecting llvmlite>=0.29.0dev0 (from numba==0.45)
Using cached https://files.pythonhosted.org/packages/50/cc/04526507e80d546be5688ce0246e40277b61e7949c3347c6609b6a4154cf/llvmlite-0.32.1.tar.gz
Collecting numpy (from numba==0.45)
Collecting funcsigs (from numba==0.45)
Using cached https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl
Collecting enum34 (from numba==0.45)
Using cached https://files.pythonhosted.org/packages/6f/2c/a9386903ece2ea85e9807e0e062174dc26fdce8b05f216d00491be29fad5/enum34-1.1.10-py2-none-any.whl
Collecting singledispatch (from numba==0.45)
Using cached https://files.pythonhosted.org/packages/cd/d1/6a9e922826e03f5af7bf348cfb75bcb0bc4c67e19c36805c2545f34427e5/singledispatch-3.6.2-py2.py3-none-any.whl
Collecting six (from singledispatch->numba==0.45)
Using cached https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Building wheels for collected packages: numba, llvmlite
Running setup.py bdist_wheel for numba ... done
Stored in directory: /home/nvidia/.cache/pip/wheels/51/5d/c0/420ea2fced22bb1702a294c2cbc0dcaefd6ed61f3d6253fd61
Running setup.py bdist_wheel for llvmlite ... error
Complete output from command /usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ni4NGO/llvmlite/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 /tmp/tmpwjzE5mpip-wheel- --python-tag cp27:
running bdist_wheel
/usr/bin/python2.7 /tmp/pip-build-ni4NGO/llvmlite/ffi/build.py
File "/tmp/pip-build-ni4NGO/llvmlite/ffi/build.py", line 122
raise ValueError(msg.format(_ver_check_skip)) from e
^
SyntaxError: invalid syntax
error: command '/usr/bin/python2.7' failed with exit status 1
----------------------------------------
Failed building wheel for llvmlite
Running setup.py clean for llvmlite
Successfully built numba
Failed to build llvmlite
Installing collected packages: llvmlite, numpy, funcsigs, enum34, six, singledispatch, numba
Running setup.py install for llvmlite ... error
Complete output from command /usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ni4NGO/llvmlite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-XAdkTG-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
got version from file /tmp/pip-build-ni4NGO/llvmlite/llvmlite/_version.py {'version': '0.32.1', 'full': 'aa11b129c0b55973067422397821ae6d44fa5e70'}
running build_ext
/usr/bin/python2.7 /tmp/pip-build-ni4NGO/llvmlite/ffi/build.py
File "/tmp/pip-build-ni4NGO/llvmlite/ffi/build.py", line 122
raise ValueError(msg.format(_ver_check_skip)) from e
^
SyntaxError: invalid syntax
error: command '/usr/bin/python2.7' failed with exit status 1
----------------------------------------
Command "/usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ni4NGO/llvmlite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-XAdkTG-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-ni4NGO/llvmlite/

I solved it.
What worked for me was
sudo apt-get install python-numba

Try to upgrade pip and install the latest versions that support Python 2.7:
python2.7 -m pip install -U "pip < 21.0"
python2.7 -m pip install "llvmlite < 0.32.1" "numba < 0.46"

Related

Error while Installing Pillow / PyAutoGUI on Windows 10

i wanted to install PyAutoGUI via pip.
It worked, until it installed Pillow.
Here is the error:
Command "c:\users\erazor\appdata\local\programs\python\python38\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Erazor\AppData\Local\Temp\pip-install-ff50gy2x\Pillow\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\Erazor\AppData\Local\Temp\pip-record-hfqa44g5\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Erazor\AppData\Local\Temp\pip-install-ff50gy2x\Pillow\
Here is a Hastebin forme the command promt.
I hope you can help me.
EDIT: I tried han solos comment. It did not Work its the Same error but now i get
Failed building wheel for Pillow
as an additional error.
EDIT: New error:
Building wheels for collected packages: Pillow
Building wheel for Pillow (setup.py) ... error
Failed building wheel for Pillow
Running setup.py clean for Pillow
Failed to build Pillow
Installing collected packages: Pillow, pyscreeze, pyautogui
Running setup.py install for Pillow ... error
Command "c:\users\erazor\appdata\local\programs\python\python38\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Erazor\AppData\Local\Temp\pip-install-m5b1ubtx\Pillow\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\Erazor\AppData\Local\Temp\pip-record-ot3l1c72\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Erazor\AppData\Local\Temp\pip-install-m5b1ubtx\Pillow\
Pillow's latest supported Python version is 3.7, not 3.8.

Failed building wheel for libvirt-python CentOS

I'm running CentOS and trying to install openstack.
If I install libvirt-python, it will install the latest version e.g.
pip install --user libvirt-python
Collecting libvirt-python
Installing collected packages: libvirt-python
Successfully installed libvirt-python-4.10.0
However, the upper_constraints.txt (which is dynamically updated at runtime, not sure where it's getting set) lists
libvirt-python===3.10.0
If I uninstall libvirt-python and try to install 3.10.0 I'm getting a wheel error (see below). Can anyone help me with this?
pip install --user libvirt-python==3.10.0
Collecting libvirt-python==3.10.0
Using cached
https://files.pythonhosted.org/packages/20/b3/d7e226a07efa1432a4dcf92b3baa0cf554241a7eecd8a654c23c2119b190/libvirt-python-3.10.0.tar.gz
Building wheels for collected packages: libvirt-python
Running setup.py bdist_wheel for libvirt-python ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Ry0ikH/libvirt-python/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 /tmp/pip-wheel-GwcOJA --python-tag cp27:
running bdist_wheel
running build
/usr/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
/usr/bin/python generator.py libvirt /usr/share/libvirt/api/libvirt-api.xml
Found 446 functions in /usr/share/libvirt/api/libvirt-api.xml
Found 0 functions in libvirt-override-api.xml
Generated 355 wrapper functions
Missing type converters:
virNWFilterBindingPtr:8
virTypedParameterPtr *:2
virNWFilterBindingPtr **:1
char **:1
ERROR: failed virConnectBaselineHypervisorCPU
ERROR: failed virConnectListAllNWFilterBindings
ERROR: failed virDomainGetLaunchSecurityInfo
ERROR: failed virNWFilterBindingCreateXML
ERROR: failed virNWFilterBindingDelete
ERROR: failed virNWFilterBindingFree
ERROR: failed virNWFilterBindingGetFilterName
ERROR: failed virNWFilterBindingGetPortDev
ERROR: failed virNWFilterBindingGetXMLDesc
ERROR: failed virNWFilterBindingLookupByPortDev
ERROR: failed virNWFilterBindingRef
ERROR: failed virNodeGetSEVInfo
error: command '/usr/bin/python' failed with exit status 1
Failed building wheel for libvirt-python
Running setup.py clean for libvirt-python
Failed to build libvirt-python
Installing collected packages: libvirt-python
Running setup.py install for libvirt-python ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Ry0ikH/libvirt-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-7u_zLd/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
/usr/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
/usr/bin/python generator.py libvirt /usr/share/libvirt/api/libvirt-api.xml
Found 446 functions in /usr/share/libvirt/api/libvirt-api.xml
Found 0 functions in libvirt-override-api.xml
Generated 355 wrapper functions
Missing type converters:
virNWFilterBindingPtr:8
virTypedParameterPtr *:2
virNWFilterBindingPtr **:1
char **:1
ERROR: failed virConnectBaselineHypervisorCPU
ERROR: failed virConnectListAllNWFilterBindings
ERROR: failed virDomainGetLaunchSecurityInfo
ERROR: failed virNWFilterBindingCreateXML
ERROR: failed virNWFilterBindingDelete
ERROR: failed virNWFilterBindingFree
ERROR: failed virNWFilterBindingGetFilterName
ERROR: failed virNWFilterBindingGetPortDev
ERROR: failed virNWFilterBindingGetXMLDesc
ERROR: failed virNWFilterBindingLookupByPortDev
ERROR: failed virNWFilterBindingRef
ERROR: failed virNodeGetSEVInfo
error: command '/usr/bin/python' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Ry0ikH/libvirt-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-7u_zLd/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-Ry0ikH/libvirt-python/
Found two upper_constraints files. One is in the python site-packages. Updated both for libvirt-python and that has fixed it (or at least moved me on to the next install error!)
it needs dev tool installation
use: apt-get install libvirt-dev to install dev tool then t

Pip install error (Pyside to Raspberry Pi)

I'm trying to pip install pyside to my Raspberry Pi and receive the following error:
pi#raspberrypi:/ $ sudo pip install pyside
Collecting pyside
Using cached https://files.pythonhosted.org/packages/36/ac/ca31db6f2225844d37a41b10615c3d371587677efd074db29855e7035de6/PySide-1.2.4.tar.gz
Building wheels for collected packages: pyside
Running setup.py bdist_wheel for pyside ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/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 /tmp/tmps80BMupip-wheel- --python-tag cp27:
Removing /tmp/pip-build-TXwQwt/pyside/pyside_package
running bdist_wheel
running build
Python architecture is 32bit
error: Failed to find cmake. Please specify the path to cmake with --cmake parameter.
----------------------------------------
Failed building wheel for pyside
Running setup.py clean for pyside
Failed to build pyside
Installing collected packages: pyside
Running setup.py install for pyside ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-5BdNE7-record/install-record.txt --single-version-externally-managed --compile:
Removing /tmp/pip-build-TXwQwt/pyside/pyside_package
running install
running build
Python architecture is 32bit
error: Failed to find cmake. Please specify the path to cmake with --cmake parameter.
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-5BdNE7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-TXwQwt/pyside/
pi#raspberrypi:/ $
I've tried fixing it with sudo pip install setuptools --no-use-wheel --upgrade, sudo apt install -y libmysqlclient-dev, python setup.py install, and sudo pip install --upgrade setuptools but none have worked to allow me to install Pyside. Any help would be much appreciated. Thank you.
I'm running Raspbian Stretch on a raspberry pi 3 if that matters.
You can try precompiled wheels from https://www.piwheels.org/
There are no pyside binary wheels for Pi so you need to install a lot of prerequisites and compiles from sources:
sudo apt-get install build-essential git cmake libqt4-dev libphonon-dev python2.7-dev libxml2-dev libxslt1-dev qtmobility-dev libqtwebkit-dev
which python version you are using, since this module supports only below listed version.
[(2.6), (2.7), (3.2), (3.3), (3.4)]
It looks self explanatory.
You are installing the module on an unsupported version of python.
try installing with pip2 install pyside

libvirt-python install on mac error

When i try to install libvirt-python via the following:
pip install libvirt-python
I get the following error:
Collecting libvirt-python
Downloading libvirt-python-2.5.0.tar.gz (172kB)
100% |████████████████████████████████| 174kB 2.4MB/s
Building wheels for collected packages: libvirt-python
Running setup.py bdist_wheel for libvirt-python ... error
Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-build-JcUj3e/libvirt-python/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 /var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/tmp79QS6spip-wheel- --python-tag cp27:
running bdist_wheel
running build
/usr/local/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
/usr/local/opt/python/bin/python2.7 generator.py libvirt /usr/local/Cellar/libvirt/3.0.0/share/libvirt/api/libvirt-api.xml
Found 418 functions in /usr/local/Cellar/libvirt/3.0.0/share/libvirt/api/libvirt-api.xml
Found 0 functions in libvirt-override-api.xml
Generated 344 wrapper functions
Missing type converters:
virConnectSecretEventGenericCallback:1
virStorageVolInfoPtr:1
ERROR: failed virConnectSecretEventRegisterAny
ERROR: failed virStorageVolGetInfoFlags
error: command '/usr/local/opt/python/bin/python2.7' failed with exit status 1
----------------------------------------
Failed building wheel for libvirt-python
Running setup.py clean for libvirt-python
Failed to build libvirt-python
Installing collected packages: libvirt-python
Running setup.py install for libvirt-python ... error
Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-build-JcUj3e/libvirt-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-eNRl_m-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
/usr/local/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
/usr/local/opt/python/bin/python2.7 generator.py libvirt /usr/local/Cellar/libvirt/3.0.0/share/libvirt/api/libvirt-api.xml
Found 418 functions in /usr/local/Cellar/libvirt/3.0.0/share/libvirt/api/libvirt-api.xml
Found 0 functions in libvirt-override-api.xml
Generated 344 wrapper functions
Missing type converters:
virConnectSecretEventGenericCallback:1
virStorageVolInfoPtr:1
ERROR: failed virConnectSecretEventRegisterAny
ERROR: failed virStorageVolGetInfoFlags
error: command '/usr/local/opt/python/bin/python2.7' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-build-JcUj3e/libvirt-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-eNRl_m-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-build-JcUj3e/libvirt-python/
Any help would be appreciated as I'm out of ideas on how to fix this.
Mac 10.11.4
Python 2.7.13 & 2.7.10
libvirt installed via brew
Warning: libvirt-3.0.0 already installed
You need to install libvirt-python 3.0.0 but the one on PyPI is still 2.5.0. Run this command instead:
pip install https://libvirt.org/sources/python/libvirt-python-3.0.0.tar.gz
Reference:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852886
We forgot to upload the 3.0.0 release to PyPI. This mistake is resolved now, so if you retry it should build correctly.

pip install dryscrape fails with "error: [Errno 2] No such file or directory: 'src/webkit_server'"?

I need to install dryscrape for python but I got error, what's the problem?
C:\Users\parvij\Anaconda3\Scripts>pip install dryscrape
I got this:
Collecting dryscrape
Collecting webkit-server>=1.0 (from dryscrape)
Using cached webkit-server-1.0.tar.gz
Collecting xvfbwrapper (from dryscrape)
Requirement already satisfied (use --upgrade to upgrade): lxml in c:\users\parvij\anaconda3\lib\site-packages (from dryscrape)
Building wheels for collected packages: webkit-server
Running setup.py bdist_wheel for webkit-server ... error
Complete output from command c:\users\parvij\anaconda3\python.exe -u -c"import setuptools,tokenize;__file__='C:\\Users\\parvij\\AppData\\Local\\Temp\\pip-build-o7nlv0dz\\webkit-server\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\parvij\AppData\Local\Temp\tmp71w59qv6pip-wheel- --python-tag cp35:
running bdist_wheel
running build
'make' is not recognized as an internal or external command,
operable program or batch file.
error: [Errno 2] No such file or directory: 'src/webkit_server'
----------------------------------------
Failed building wheel for webkit-server
Running setup.py clean for webkit-server
Failed to build webkit-server
Installing collected packages: webkit-server, xvfbwrapper, dryscrape
Running setup.py install for webkit-server ... error
Complete output from command c:\users\parvij\anaconda3\python.exe -u -c"import setuptools,tokenize;__file__='C:\\Users\\parvij\\AppData\\Local\\Temp\\pip-build-o7nlv0dz\\webkit-server\\setup.py';exec(compile(getattr(tokenize, 'open',open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\parvij\AppData\Local\Temp\pip-tyzalid7-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
'make' is not recognized as an internal or external command,
operable program or batch file.
error: [Errno 2] No such file or directory: 'src/webkit_server'
----------------------------------------
Command "c:\users\parvij\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\parvij\\AppData\\Local\\Temp\\pip-build-o7nlv0dz\\webkit-server\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\parvij\AppData\Local\Temp\pip-tyzalid7-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\parvij\AppData\Local\Temp\pip-build-o7nlv0dz\webkit-server\
my operating system is windows 8
my python version is 3.5
Download webkit-server from github
git clone https://github.com/niklasb/webkit-server.git webkit-server
Change in webkit-server/setup.py :
shutil.copy('src/webkit_server', self.build_purelib)
shutil.copy('src/webkit_server', self.build_platlib)
to
shutil.copy('src/webkit_server.pro', self.build_purelib)
shutil.copy('src/webkit_server.pro', self.build_platlib)
then
cd webkit-server
python setup.py install
There you go.
Need to install http://www.qt.io. Also, The 5.6+ version of Qt removes the Qt WebKit module in favor of the new module Qt WebEngine. So far, webkit-server has not been ported to WebEngine (and likely won't be in the near future), so Qt <= 5.5 is a requirement.
From the doc, you have to installed also requirements.
You can do this as follow
pip install -r requirements.txt
After this retry to install dryscrape.
Need do install qt4 and libqtwebkit-dev for compile webkit-server, then follow the steps of #Erwan Clügairtz
sudo apt install libqtwebkit-dev qt4

Categories

Resources