Python Selenium noarch RPM build failure - python

Attempting to build Python Selenium noarch rpm from downloaded selenium-2.20.0.tar.gz
All necessary Python requirements are installed and working, using command:
python setup.py bdist --format=rpm
RPMBuild fails with error message:
Arch dependent binaries in noarch package
error: command 'rpmbuild' failed with exit status 1
Have tried following the suggestion of adding an additiional %define to the selenium.SPEC file, found under build/bdist.linux-i686/rpm/SPECS/selenium.spec
%define _binaries_in_noarch_packages_terminate_build 0
Unfortunately when i re-run the RPM build, the change is not picked up and the contents of the SPEC file after the build seem to have re-verted as the newly added %define is no longer present?!
Any suggestions welcome please..

Changes to selenium.spec weren't persisting as the spec file is automatically generated from content mostly from within setup.py
Two solutions were found:
1) Download most recent version of selenium-2.20.0.tar.gz from http://pypi.python.org/pypi/selenium/ to target machine, tar extract and run:
python setup.py install
2) Install python pip, then use pip to dowload and install the latest selenium in an automated fashion with the command:
pip install -U selenium
As yet i have not found the exact content that can be added to setup.py that will add the necessary RPM build define to the selenium.spec file for creating an installation RPM..

For the future if anyone comes across this
python setup.py bdist_rpm --force-arch x86_64
Worked for me

Related

Python - Installation build wheel error when installing from local directory

I want to install a package from GitHub that uses Cython (https://github.com/mlysy/kalmantv). I cloned the package locally, and after trying to install it with pip install ., I'm getting the following error:
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Processing /Users/me/Downloads/kalmantv
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk
cwd: /Users/me/Downloads/kalmantv
Complete output (6 lines):
running egg_info
writing kalmantv.egg-info/PKG-INFO
writing dependency_links to kalmantv.egg-info/dependency_links.txt
writing requirements to kalmantv.egg-info/requires.txt
writing top-level names to kalmantv.egg-info/top_level.txt
error: package directory 'eigen-3.3.7' does not exist
----------------------------------------
WARNING: Discarding file:///Users/me/Downloads/kalmantv. Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
ERROR: Command errored out with exit status 1: /Users/me/.pyenv/versions/3.8.3/bin/python3.8 /Users/me/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/g1/0pjsd_bs24jgccrd6g0lzfvc0000gn/T/tmpxmrdlgnk Check the logs for full command output.
I tried adding --use-feature=in-tree-build from the deprecation warning but still got the error (without the initial warning).
I saw a number of suggestions such as using pip install --upgrade pip setuptools wheel, but nothing is doing the trick. I would guess that this has a simple fix but this stuff is a little over my head and I don't want to break anything else.
What do I need to do to safely correct this issue without causing other problems?
The setup.py file has the following lines:
# path to eigen library
EIGEN_PATH = r"eigen-3.3.7"
Strangely, it seems to expect the Eigen header library to be present at that location. You can install the library with brew install eigen, or sudo apt install libeigen3-dev. Note that this may not install version 3.3.7 of the library, which the project expects. I don't know if using a newer version would cause any issues.
If you want to install version 3.3.7, you can build and install it from source with the following link by following these instructions:
https://gitlab.com/libeigen/eigen/-/releases/3.3.7
Once that's done, change to the project directory, and create a symlink to the Eigen library:
If installed with brew: ln -s /usr/local/Cellar/eigen/*/include/eigen3 eigen-3.3.7
If installed with apt: ln -s /usr/include/eigen3 eigen-3.3.7
If installed from source: /usr/local/include/eigen3 eigen-3.3.7
Once the Eigen library has been installed and made available at ./eigen-3.3.7, pip install . should work, but for good measures you should run the following command first:
pip install -U pip setuptools wheel; pip install -U cython
Refer to Catalina C++: Using <cmath> headers yield error: no member named 'signbit' in the global namespace if you run into an error like: error: no member named 'signbit' in the global namespace.

Error installing PyMVPA2

I'm getting the following error when I try to install using pip install for PyMVPA2 for Python. I have installed other libraries without any problems before. I would appreciate if anything could take a look at the errors:
C:\Users\usr>pip install pymvpa2
Collecting pymvpa2
Using cached pymvpa2-2.4.2.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
running build_src
build_src
building extension "mvpa2.clfs.libsmlrc.smlrc" sources
building extension "mvpa2.clfs.libsvmc._svmc" sources
creating build
creating build\src.win32-2.7
creating build\src.win32-2.7\mvpa2
creating build\src.win32-2.7\mvpa2\clfs
creating build\src.win32-2.7\mvpa2\clfs\libsvmc
swig.exe++: mvpa2\clfs\libsvmc\svmc.i
swig.exe -python -I3rd\libsvm -c++ -I3rd\libsvm -o build\src.win32- 2.7\mvpa2\clfs\libsvmc\svmc_wrap.cpp -outdir build\src.win32-2.7\mvpa2\clfs\libsvmc mvpa2\clfs\libsvmc\svmc.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\usr\appdata\local\temp\pip-build-v_zzkd\pymvpa2\
As the error states you either don't have swig installed or it is not on your path. You are obviously on Windows so you need to download the swig executable from the swig website - download the latest windows package and either unzip it to a directory on your existing path or to a new directory and add it to your path. Easiest, of course, is to unzip it to a new directory and then run your pip command in that directory.
What is swig anyway? Swig parses the interface definitions of code written in C/C++ and can output 'glue code' to allow code written in Python & a pile, currently 22, of other programming or scripting languages to use the C/C++ code transparently. Swig is free, open source and compatible with both open source and commercial use.
Should I keep it to hand? In most cases that I know of in python swig is only invoked during the installation or setup phase but since that setup phase will be used every time that any package built with swig is installed or upgraded there is no reason to get rid of it and quite a lot of reasons to have it somewhere on your path.
sudo apt-get remove swig
sudo apt-get install swig3.0
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
and then
pip install pymvpa2

.whl is not a valid wheel filename, storing debug log for failure in C:\

I am having trouble installing a wheel file via pip.
I open my command prompt
write the following in the prompt
C:/Python34/Scripts/pip install C:/Users/Hamsa/Downloads/pygame.whl
Then I get this message
pygame.whl is not a valid wheel filename. Storing debug log for failure in C:\Users\Hamsa\pip\pip.log
I don't what to do and I need your help.
You should correct name format for installing wheel file. Because wheel file name also includes many information such as the version of program, supported python version. Your command should be like the command below.
pip install pygame‑1.9.3‑cp34‑cp34m‑win_amd64.whl
If the answer suggested by #Harun doesnot work, try
python -m pip install <whl file name with complete path>.whl
If u have more than 1 Python versions installed , check which version of python is being used to install the package using:
python -v
Also refer to pygame readme for an official installation guide.

Installing (build) matplotlib in mac osx lion

I installed pynum and scipy (on osx Lion with python 2.7), but when I tried to build matplotlib
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
python setup.py build
python setup.py install
I've got these errors:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h:242: error: declaration for parameter ‘FMFontDirectoryFilter’ but no such parameter
src/_macosx.m:5912: error: expected ‘{’ at end of input
lipo: can't open input file: /var/folders/qw/pr2f7vq91b3c3ngkxrrqplm8zkv09r/T//ccAgEklo.out (No such file or directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Could somebody please tell me what is the problem?
P.S.
At first I tried to install it in this way:
pip install -e git+https://github.com/matplotlib/matplotlib#egg=matplotlib-dev
but it does not worked for me
I always find this process more painful than it should be, but I've done it a few times now and I believe that these steps should get you set up:
Get Xcode 4.3.2, it's required for some of the later steps.
Download the latest version of python for OSX from python.org
Grab the Scipy superpack.
Uninstall any previous versions of numpy/matplotlib/scipy that you currently have. That includes doing cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ and moving any numpy/matplotlib/scipy directories or eggs into a temp directory.
cd ~/Downloads(or wherever you downloaded the superpack script to) and run sh install_superpack.sh. Answer no to the question are you installing from a repository cloned to this machine or you'll be confused about why the script keeps failing.
That should be it! You should now be able to boot up the python console and import numpy, scipy, matplotlib.

Why am I getting the error: command 'llvm-gcc-4.2' failed with exit status 1

I am setting up os X 10.7.
I am using the default install of Python:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
I use a Python based package manager called easy_install.
Easy_install seems to not be able to find the compiler.
EDIT: When I tried to install MySQL-python I got this error:
$ sudo easy_install MySQL-python
Password:
Searching for MySQL-python
Reading http://pypi.python.org/simple/MySQL-python/
Reading http://sourceforge.net/projects/mysql-python/
Reading http://sourceforge.net/projects/mysql-python
Best match: MySQL-python 1.2.3
Downloading http://download.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz
Processing MySQL-python-1.2.3.tar.gz
Running MySQL-python-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-P9H9WX/MySQL-python-1.2.3/egg-dist-tmp-rRTfZL
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
unable to execute llvm-gcc-4.2: No such file or directory
error: Setup script exited with error: command 'llvm-gcc-4.2' failed with exit status 1
error: Setup script exited with error: command 'llvm-gcc-4.2' failed with exit status 1
Xcode 4.1 used GCC, but with Xcode 4.2 that seems to have changed.
What compiler does Apple want us to use?
How do I setup the configuration so I can compile OSS?
I had the exact same problem when I upgraded from OSX 10.6 to 10.7. If you upgrade to 10.7 from 10.6, your version of Python may go from 2.6 to 2.7 and a result you may need to re-install most of your python packages.
Here's what worked for me:
Install the latest version of XCode from the App Store
Inside XCode, go to Preferences -> Downloads -> Components
download the Command Line Tools
That's all you need to do. Try to install again in a new shell. The command line tool installation will put llvm-gcc-4.2 into /usr/bin which should be in your default path. The installation also takes care of library paths and stuff that you don't really want to know about unless something breaks.
10.9 edit
If you're running 10.9 or higher, I think you might be able to run this from the command line instead to install the command line tools:
xcode-select --install
I haven't verified that this is an actual fix to the problem.
Alternative to installing Xcode, install GCC and related tools via:
https://github.com/kennethreitz/osx-gcc-installer
Sounds to me you ran into this issue. The thread shows a variety of solutions.
Hope that helps.
The fix is quite simple. Check out the following blogpost.
http://waqasshabbir.tumblr.com/post/19073648382/llvm-gcc-4-2-exe-error-on-mac-osx-lion-when-building
Using OS X 10.7.5 (Lion)
I tried the XCode solution, but my gevent pip installation still wasn't successful. Then, I tried building libevent from source but still no success with gevent installation. However, after I did
brew install libevent
I was able to successfully install gevent with
sudo pip install gevent
(Note: greenlet is also a dependency for gevent, so you may try installing it with pip as well. It was already installed on my machine.)
All of the suggestions here (Xcode command line options, and Kenneth Reitz' stuff) didn't work for me (I am on Mac OS X 10.7.5, Xcode 4.6.3).
What helped in the end was altering the cflags options in the mysql_config file (There were errors about 'unreconized command line options' while trying to 'sudo pip install MySQL-python').
See this post: cc1: error: unrecognized command line option "-Wno-null-conversion" within installing python-mysql on mac 10.7.5

Categories