Python AttributeError: module 'rpm' has no attribute 'TransactionSet' - python

Getting this error`Python AttributeError: module 'rpm' has no attribute 'TransactionSet'. Installed rpm module like this pip3 install rpm. Do I need to install any other modules?

I don't know this module, but I hope I can help.
I imagine that you have installed this module via pip install rpm
Pypi offical docs says: https://pypi.org/project/rpm/
Placeholder package to make the RPM Python API available through PyPI.
Right now, this package just reserves the rpm name on PyPI to avoid the >potential for a name conflict with the python2-rpm and python3-rpm Python >bindings on RPM-based Linux distros.
Unlike libsolv and libdnf (which use CMake, and are hence amenable to PyPI >compatible build automation with scikit-build), rpm itself still uses >autotools, so creating usable pip-installable Python bindings for it may be >a bit trickier than doing so for the other libraries.
So un-install this package pip uninstall rpm and then install it from system scope apt-get install python3-rpm.
Maybe you need to re-install virtualenv like virtualenv --system-site-packages rpm and make rpm available to virtenv. Because apt-get install will enable rpm for system python, not for virtualenv

Related

Changing directory where pip installs packages

I have a python2.6 installed on Oracle linux.
I decided to use a newer python version and installed python 2.7.13.
I have also installed pip to manage packages.
Now if I use pip to install a package it still installs it to the old location: /usr/lib/python2.6/site-packages
Is there a way to force pip to install packages for the newer python 2.7 version?
Posable Repeat Post
"Use a version of pip installed against the Python instance you want to install new packages to.
In many distributions, there may be separate python2.6-pip and python2.7-pip packages, invoked with binary names such as pip-2.6 and pip-2.7. If pip is not packaged in your distribution for the desired target, you might look for a setuptools or easyinstall package, or use virtualenv (which will always include pip in a generated environment).
pip's website includes installation instructions, if you can't find anything within your distribution." ~Charles Duffy
Taken from How to install a module use pip for specific version of?
Did you check Install a Python package into a different directory using pip?.
To install in specified target directory use "pip install --target= "
Oracle Linux uses the system-installed version of Python for almost all of its command-line utilities, so changing that could irreparably damage your system.
Instead of replacing the default Python install, you should strongly consider using Python 2.7 from Software Collections instead.
Using Software Collections means that the install of Python 2.7 is separated from the system install, so you don't run the risk of damaging your system. You can then make it available to your applications via the scl tool.

correct package name for glibc in Amazon Linux EBS

I need to install glibc-devel package for my EBS python 2.7 64 bits at AWS.
Different from any other solutions, I have to install python27-devel instead of python-devel, postgresql93-devel instead of postgresql-devel, so I was wondering the correct name for glibc-devel package because with that name it seems to skipt the installation yum packages (.ebextensions/config file).
The main problem is to install lxml from pip packages. I successfully installed libxslt-devel and libxml2-devel in that server, also gcc and patch.
Answer to my question, the package name is: glibc-devel.i686

Download python package with dependencies without installing

I need to download a python package with all its dependencies without installing, sneaker-net it to a computer without connection to the internet, and install it there. For example, I want to install buildbot, lettuce, etc.
The computer is a Windows 7 machine, using Python 2.7.
If the package has native extensions, I can build them on the computer.
You can use pip, with the --download option, which will download the main package and its dependancies, without installing them.
pip install --download="/path/to/downloaded/files" sneaker-net
And use these files one the local machine with:
pip install --no-index --find-links=<DIR on local machine> sneaker-net
See pip documentation --download for fast & local installs. You can use pip on Windows with cygwin for example.

Local install / uninstall of PyQt (pip interface?)

The installation instructions for PyQt say:
python configure-ng.py
make
make install
I usually work on a personal virtualenv environment, and pip install -e <path_to_package_source_folder> allows me to install Python packages from source in a manner that allows me later to uninstall the package with pip uninstall <name_of_package>.
However, for PyQt, If I try:
python configure-ng.py
pip install -e .
it complains with No setup.py found.
Is there a way to build PyQt in a manner that allows for easy uninstall it later? (e.g. this could happen because that there is a new version of PyQt and I would like to upgrade to it)
Try to provide the -destdir argument (see the notes about PYTHONPAT), that should do the trick. I doubt PyQt4 supports installation via pip/setuptools/distribute.
To uninstall it later it should be enough to delete the installed files.

How to add PyPi dependencies to DEB package

I created some python app using autobahn and packaged it using baazar builddeb. In python setup.py file I added requires tag with all the required dependencies. Is it possible to tell debian package installer to install these packages?
I added some of deps to debian/control>Depends but:
dpkg -i my_package does not install dependencies. Just shows the error and I need to install these deps manually.
some packages does not exists in standard Ubuntu repos. For example autobahn. And in general I'd like to have installed all python dependencies by pip/easy_install
I am using DistUtilsExtra.auto.setup with personalized install action. So I think I could run easy_install packages there. Is it good idea?
Thank you.
Create debian packages from pypi using the python-stdeb package, then depend on them like any other package.
See http://pypi.python.org/pypi/stdeb

Categories