|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
'import pymqi' not found Linux |
« View previous topic :: View next topic » |
Author |
Message
|
bobbee |
Posted: Fri Jul 29, 2022 7:44 am Post subject: 'import pymqi' not found Linux |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
I have an internal Linux box. Installed Python using root, Then I build/install pymqi. On this server I can run my script from 'mqm' and it works fine.
On my customers Linux box I did the same. I can run my script under root and it gets down into the code and fails on a 2035 trying to access the QMGR. FAIR!!
When I to run the script under 'mqm' I get 'import pymqi' not found. Why the difference. I did a setup.py looking at --help and --help-commands and I do not see options about accessibility.
Anyone have a suggestion? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jul 31, 2022 1:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
check file ownership and accessibility of the pymodule.
you may have to do a chown mqm:users and chmod -R a+rx
Hope it helps  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bobbee |
Posted: Mon Aug 01, 2022 2:55 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
Thanks, that was what it was. I thought opening up the modules was enough. I opened up everything under 'site-packages'. Once I opened up 'site-packages' it started working. Interesting once would compile a package such as this and it is only accessible by root. Thanks! |
|
Back to top |
|
 |
gbaddeley |
Posted: Mon Aug 01, 2022 3:02 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Generally I try to avoid doing anything from root, unless it actually requires root privileges. Its too easy to blur the distinction between doing actions that you think don't require root, but actually bypass security controls etc. because you are root. Then some time later you try to replicate the actions from a non-privileged user and it doesn't have the same result, or fails. _________________ Glenn |
|
Back to top |
|
 |
EnigmaticCypher |
Posted: Mon Aug 08, 2022 4:24 am Post subject: |
|
|
Newbie
Joined: 01 Jan 2022 Posts: 5
|
This ladies and gentlemen, is why you never install python packages at the OS level as root.
Do what you're supposed to do, and use virtual environments Compile a PyMQI wheel file for the platform you're targeting (x86 / ppc64le / ARM64 etc), and then install PyMQI into a venv with the wheel file.
Default MQ client installations set the relevant modules to have r+x to the world, so unless somebody explicitly messes with that (which they shouldn't be doing unless they know exactly what they're doing, because it causes problems like this) then everything just works. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|