LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-29-2023, 02:49 PM   #1
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Installed Solaar-1.1.9, hte gui will not start.


This is on 15, not current. I get the following output when I start solaar, as a regular user.

Code:
solaar
solaar: error: Traceback (most recent call last):
  File "/usr/lib64/python3.9/site-packages/solaar/gtk.py", line 165, in main
    import solaar.listener as listener
  File "/usr/lib64/python3.9/site-packages/solaar/listener.py", line 34, in <module>
    from logitech_receiver import notifications as _notifications
  File "/usr/lib64/python3.9/site-packages/logitech_receiver/notifications.py", line 27, in <module>
    from . import diversion as _diversion
  File "/usr/lib64/python3.9/site-packages/logitech_receiver/diversion.py", line 33, in <module>
    import psutil
  File "/usr/lib64/python3.9/site-packages/psutil/__init__.py", line 102, in <module>
    from . import _pslinux as _psplatform
  File "/usr/lib64/python3.9/site-packages/psutil/_pslinux.py", line 87, in <module>
    PAGESIZE = cext_posix.getpagesize()
AttributeError: module 'psutil._psutil_posix' has no attribute 'getpagesize'
I can run the program command line though.

During the install, I created a sqf file for solaar, this was yesterday while, unknown to me downloading things from the git hub were problematic.

After the sqf install ended, some packages were missing. I went through the dependencies, and manually downloaded and built the missing pieces.

I have checked and verified I have all the dependencies installed.

I did some searching on the 'getpagesize' error. I have not found a fix for this error.

I would add I am not all that familiar with Python, or writing programs.

Here is the contents of Solaar.sqf.

Code:
cat /var/lib/sbopkg/queues/Solaar.sqf
python3-flit_core
python3-installer
python3-wheel
python3-pyproject-hooks
python3-build
python3-psutil
python3-xlib
pyudev
python-evdev
Solaar
Could the fact that the orginal run did not complete, the order of the installed packages is causing the problem?

Any other thoughts on a fix?
 
Old 08-29-2023, 04:26 PM   #2
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,409

Rep: Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142
It probably won't help but no issue here
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20230829_232550.png
Views:	25
Size:	91.4 KB
ID:	41543  

Last edited by marav; 08-29-2023 at 04:27 PM.
 
Old 08-29-2023, 04:35 PM   #3
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Original Poster
Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
I suspected as much, thank-you for the reply.

I think I have something wrong with the python packages I have installed. This is on 15. This system was origonally installed as 14.2, I went to current ( before 15 was released ) and installed some packages from ponce and alienbob. When 15 was released, I simply followed the instrucitons on this system to stay on 15.

What I would like to do is just remove any python packages that are not part of 15 to get a cleaner system. Of course that may break some things that are not part of 15, ie sbo packages.

Not sure how to go about that.
 
Old 08-29-2023, 09:21 PM   #4
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,979

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by camorri View Post
I think I have something wrong with the python packages I have installed. This is on 15. This system was origonally installed as 14.2, I went to current ( before 15 was released ) and installed some packages from ponce and alienbob. When 15 was released, I simply followed the instrucitons on this system to stay on 15.

What I would like to do is just remove any python packages that are not part of 15 to get a cleaner system. Of course that may break some things that are not part of 15, ie sbo packages.

Not sure how to go about that.
This is what I would do. Use slackpkg. I do not know if you use slackpkg package or not, so I will go with not. If you do then... adjust as needed. You may only need to run the last command in the list below.

Make sure that packages you want to keep, i.e., SBo packages are listed in /etc/slackpkg/blacklist. Make sure that the mirror in /etc/slackpkg/mirrors is pointing to a 15.0 mirror. The run as root:
Code:
slackpkg gpg
slackpkg update
slackpkg install-new
slackpkg upgrade-all
slackpkg clean-system
Before hitting "< OK >" with 'slackpkg clean-system' review the list of files uncheck any you want to keep (shouldn't be any unless you didn't add them to "blacklist". If there are no packages found then it means your system is clean of 14.2 packages.

This should clean up packages that are not part of slackware 15.0.

Yes this could break some of your third party packages, should hopefully be enough to just rebuild them.

Last edited by chrisretusn; 08-29-2023 at 09:22 PM.
 
Old 08-29-2023, 10:27 PM   #5
fourtysixandtwo
Member
 
Registered: Jun 2021
Location: Alberta
Distribution: Slackware...mostly
Posts: 325

Rep: Reputation: 216Reputation: 216Reputation: 216
No issues running it here either.

Here's a couple python commands to help you troubleshoot.

Code:
$ pip3 -V
pip 21.3.1 from /usr/lib64/python3.9/site-packages/pip (python 3.9)

# check for any user installed python packages that might override the system installed ones
$ pip3 list --user

# may show false positives because a project is too specific in their version requirements
$ pip3 check
No broken requirements found.

$ pip3 freeze | egrep -i "flit|installer|wheel|hooks|build|psutil|xlib|pyudev|evdev|solaar"
build==0.10.0
evdev==1.6.1
flit_core==3.9.0
installer==0.7.0
psutil==5.9.5
pyproject_hooks==1.0.0
python-xlib==0.33
pyudev==0.24.1
solaar==1.1.9
 
1 members found this post helpful.
Old 08-30-2023, 06:12 AM   #6
rizitis
Member
 
Registered: Mar 2009
Location: Greece,Crete
Distribution: Slackware64-current, Slint
Posts: 676
Blog Entries: 1

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
sbopkg have options to run and check your installed packages for updates..etc
Also slpkg.
I post this here as a "tip" just for everyone who might need.

If you want your non Slackware official packages to be at the same version with SBo.
Install slpkg from SBo as it is (default configs) and command:
Code:
slpkg -u
This will create database for slpkg (like sbopkg -r)

Code:
slpkg -U
This will list ALL your installed non Slackware packages with different version on SBo repo.
 
Old 08-30-2023, 01:49 PM   #7
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Original Poster
Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
I have spent a day trying to fix solaar, and have the gui run, it does not run on my system.

I have gone through the installed python packages on my system, several had 'ponce' in the package name. I removed them, and installed those packages from SBo. the problem persists.

I removed all the packages for solaar, nad re-installed the packages using a queue file. That worked without any problems. I thought, because the day I originally installed solaar, the git hub was giving us permission problems, and denial of downloads for just some packages, the order of install may have caused problems. Well, after a re-install, it still fails.

What I would like to understand, is the error on the traceback. The error:

Quote:
File "/usr/lib64/python3.9/site-packages/psutil/_pslinux.py", line 87, in <module>
PAGESIZE = cext_posix.getpagesize()
AttributeError: module 'psutil._psutil_posix' has no attribute 'getpagesize'
I looked in _pslinux.py on line 87, amd I see PAGESIZE = cext_posix.getpagesize().

There is a man page for getpagesize. From what I understand, GETPAGESIZE retrieves the memory page size. In the notes it states "Portable applications should employ sysconf(_SC_PAGESIZE) instead of getpagesize():"

I'm lost. How does one do that? And why does the site package insist on useing getpagesize?

How come no one else has this problem?

Thoughts?

For the record, here is what fortysixandtwo asked for.

Quote:
pip3 freeze | egrep -i "flit|installer|wheel|hooks|build|psutil|xlib|pyudev|evdev|solaar"
build==0.10.0
evdev==1.6.1
flit_core==3.9.0
installer==0.7.0
psutil==5.9.5
pyproject_hooks==1.0.0
python-xlib==0.33
pyudev==0.24.1
solaar==1.1.9
pip3 list --user returns nothing, and pip3 check returns:

Quote:
yt-dlp 2023.7.6 requires mutagen, which is not installed.
yt-dlp 2023.7.6 requires pycryptodomex, which is not installed.
yt-dlp 2023.7.6 requires websockets, which is not installed
I don't know what yt-dlp is, or why its installed.
 
Old 08-30-2023, 09:27 PM   #8
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 906

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
I believe this is the code in psutil that implements getpagesize:

https://github.com/giampaolo/psutil/...il_posix.c#L72

Code:
/*
 * From "man getpagesize" on Linux, https://linux.die.net/man/2/getpagesize:
 *
 * > In SUSv2 the getpagesize() call is labeled LEGACY, and in POSIX.1-2001
 * > it has been dropped.
 * > Portable applications should employ sysconf(_SC_PAGESIZE) instead
 * > of getpagesize().
 * > Most systems allow the synonym _SC_PAGE_SIZE for _SC_PAGESIZE.
 * > Whether getpagesize() is present as a Linux system call depends on the
 * > architecture.
 */
long
psutil_getpagesize(void) {
#ifdef _SC_PAGESIZE
    // recommended POSIX
    return sysconf(_SC_PAGESIZE);
#elif _SC_PAGE_SIZE
    // alias
    return sysconf(_SC_PAGE_SIZE);
#else
    // legacy
    return (long) getpagesize();
#endif
}
I don't know why it isn't working for you.

Do you have /usr/lib64/python3.9/site-packages/psutil/_psutil_posix.abi3.so?
 
1 members found this post helpful.
Old 08-30-2023, 09:29 PM   #9
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 906

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by drumz View Post
I believe this is the code in psutil that implements getpagesize:

https://github.com/giampaolo/psutil/...il_posix.c#L72

Code:
/*
 * From "man getpagesize" on Linux, https://linux.die.net/man/2/getpagesize:
 *
 * > In SUSv2 the getpagesize() call is labeled LEGACY, and in POSIX.1-2001
 * > it has been dropped.
 * > Portable applications should employ sysconf(_SC_PAGESIZE) instead
 * > of getpagesize().
 * > Most systems allow the synonym _SC_PAGE_SIZE for _SC_PAGESIZE.
 * > Whether getpagesize() is present as a Linux system call depends on the
 * > architecture.
 */
long
psutil_getpagesize(void) {
#ifdef _SC_PAGESIZE
    // recommended POSIX
    return sysconf(_SC_PAGESIZE);
#elif _SC_PAGE_SIZE
    // alias
    return sysconf(_SC_PAGE_SIZE);
#else
    // legacy
    return (long) getpagesize();
#endif
}
I don't know why it isn't working for you.

Do you have /usr/lib64/python3.9/site-packages/psutil/_psutil_posix.abi3.so?
I arrived at the above function by:

Code:
/*
 * define the psutil C module methods and initialize the module.
 */
static PyMethodDef mod_methods[] = {
    {"getpagesize", psutil_getpagesize_pywrapper, METH_VARARGS},
    {"getpriority", psutil_posix_getpriority, METH_VARARGS},
    {"net_if_addrs", psutil_net_if_addrs, METH_VARARGS},
    {"net_if_flags", psutil_net_if_flags, METH_VARARGS},
    {"net_if_is_running", psutil_net_if_is_running, METH_VARARGS},
    {"net_if_mtu", psutil_net_if_mtu, METH_VARARGS},
    {"setpriority", psutil_posix_setpriority, METH_VARARGS},
#if defined(PSUTIL_BSD) || defined(PSUTIL_OSX)
    {"net_if_duplex_speed", psutil_net_if_duplex_speed, METH_VARARGS},
#endif
    {NULL, NULL, 0, NULL}
};
(https://github.com/giampaolo/psutil/...l_posix.c#L872)

which leads to:

Code:
// Exposed so we can test it against Python's stdlib.
static PyObject *
psutil_getpagesize_pywrapper(PyObject *self, PyObject *args) {
    return Py_BuildValue("l", psutil_getpagesize());
}
(https://github.com/giampaolo/psutil/...#L164C1-L168C2)
 
2 members found this post helpful.
Old 08-31-2023, 12:43 AM   #10
fourtysixandtwo
Member
 
Registered: Jun 2021
Location: Alberta
Distribution: Slackware...mostly
Posts: 325

Rep: Reputation: 216Reputation: 216Reputation: 216
drumz's post reminded me that someone else had this problem not long ago on the slackbuilds-users mailing list. The problem was an older psutil was installed and causing the issue. Make sure to remove any earlier version as well as any python2 versions of psutil (unless it's needed and the new python2-psutil which is also version 5.9.5).

The following find command should only show the one result.
Code:
# find /usr -iname "_psutil_posix*"
/usr/lib64/python3.9/site-packages/psutil/_psutil_posix.abi3.so
You can run those earlier commands I suggested with pip2 instead of pip3 to check the python2 installed packages.

Last edited by fourtysixandtwo; 08-31-2023 at 01:07 AM.
 
1 members found this post helpful.
Old 08-31-2023, 04:57 AM   #11
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Original Poster
Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Thank-you Drumz and fortysixandtwo for your help.

This is the results of the find:

Quote:
# find /usr -iname "_psutil_posix*"
/usr/lib64/calibre/lib/python3.10/site-packages/psutil/_psutil_posix.cpython-310-x86_64-linux-gnu.so
/usr/lib64/python3.9/site-packages/psutil/_psutil_posix.cpython-39-x86_64-linux-gnu.so
/usr/lib64/python3.9/site-packages/psutil/_psutil_posix.abi3.so
/usr/lib64/python2.7/site-packages/psutil/_psutil_posix.so
It appears to me, calibre ( from alienbob ) has added a site package, and there is one for python2. Looks like that is the reason I'm having issues. Is there a way to remove unnecessary site packages ? I have little experience with python.
 
1 members found this post helpful.
Old 08-31-2023, 07:39 AM   #12
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 906

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Quote:
Originally Posted by camorri View Post
Thank-you Drumz and fortysixandtwo for your help.

This is the results of the find:



It appears to me, calibre ( from alienbob ) has added a site package, and there is one for python2. Looks like that is the reason I'm having issues. Is there a way to remove unnecessary site packages ? I have little experience with python.
This command will find what other python stuff is installed from alien packages, to give you an idea of potential issues you may have:

Code:
grep site-packages /var/lib/pkgtools/packages/*alien
Do you have any other packages installed (other than Slackware and SBo)?
 
Old 08-31-2023, 07:44 AM   #13
fourtysixandtwo
Member
 
Registered: Jun 2021
Location: Alberta
Distribution: Slackware...mostly
Posts: 325

Rep: Reputation: 216Reputation: 216Reputation: 216
Quote:
Originally Posted by camorri View Post
Thank-you Drumz and fortysixandtwo for your help.

This is the results of the find:

It appears to me, calibre ( from alienbob ) has added a site package, and there is one for python2. Looks like that is the reason I'm having issues. Is there a way to remove unnecessary site packages ? I have little experience with python.
You can ignore the private calibre result. First check if those extra entries belong to any installed packages (likely the old 'psutil' package which included both python2 and python3 versions).

Code:
# egrep "_psutil_posix.cpython-39-x86_64-linux-gnu.so|_psutil_posix.so"  /var/log/packages/* |grep -v calibre

# remove the old psutil package if my assumption is correct
Failing those not belonging to an installed package, I would:
-uninstall python3-psutil
-remove both psutil directories "/usr/lib64/python{2.7,3.9}/site-packages/psutil/"
-then reinstall python3-psutil.

Hope that helps.
 
Old 08-31-2023, 08:26 AM   #14
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,236

Original Poster
Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
I ran the egrep search, and yes, there was an ( I'm guessing ) old psutil package hanging around. I removed it;

Quote:
psutil-5.6.7-x86_64-1ponce
and no more error messages launching solaar, and the gui shows up.

Thank-you both for all your help.
 
1 members found this post helpful.
  


Reply

Tags
solaar



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting solaar to work with my Logitech devices RandomTroll Linux - Hardware 7 12-28-2020 03:41 PM
[SOLVED] Solaar not working TarFile Slackware 7 01-14-2019 09:30 PM
Logitech keyboard not connecting (Unify software in MS) using Solaar on Ubuntu 14.04 cilbuper Ubuntu 1 10-22-2016 08:34 AM
hte kill command kniwor Slackware 7 12-07-2006 12:06 PM
wine is emulating hte wrong os drigz Linux - Software 5 05-27-2004 01:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration