473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Python and MQ

1
Hi ,

I have a simple code as shown below :
Expand|Select|Wrap|Line Numbers
  1. import pymqi
  2. qmgr = pymqi.QueueManager()
  3. putQ = pymqi.Queue(qmgr, 'TESTQ1')
  4. putQ.put('Hello from Python!')
When i run this piece of code i get an error as :

File "C:\Python24\pymqi-0.5d\pymqi-0.5d\testmq.py", line 1, in ?
import pymqi
File "C:\Python24\pymqi-0.5d\pymqi-0.5d\pymqi.py", line 82, in ?
import pymqe, CMQC, CMQCFC
ImportError: No module named pymqe


Kindly advise !

Thanks & Regards,
VC
Dec 12 '06 #1
1 10384
bartonc
6,596 Expert 4TB
This thread will be renamed to include the word "installation" for future searches.

Hi ,

I have a simple code as shown below :
Expand|Select|Wrap|Line Numbers
  1. import pymqi
  2. qmgr = pymqi.QueueManager()
  3. putQ = pymqi.Queue(qmgr, 'TESTQ1')
  4. putQ.put('Hello from Python!')
When i run this piece of code i get an error as :

File "C:\Python24\pymqi-0.5d\pymqi-0.5d\testmq.py", line 1, in ?
import pymqi
File "C:\Python24\pymqi-0.5d\pymqi-0.5d\pymqi.py", line 82, in ?
import pymqe, CMQC, CMQCFC
ImportError: No module named pymqe


Kindly advise !

Thanks & Regards,
VC
This sounds like some kind of installation problem. Python doesn't automatically search directories for modules. It does search all directories listed in sys.path. and the current working directory. There are several ways to add a directory to sys.path. If, for example, pymqe, CMQC, and CMQCFC are in C:\Python24\pymqi-0.5d\ instead of C:\Python24\pymqi-0.5d\pymqi-0.5d\, a simple trick that I use is: put these lines
Expand|Select|Wrap|Line Numbers
  1. import sys
  2. sys.path.append(r"C:\Python24\pymqi-0.5d")
before
import pymqi
in your module.
Some alternatives include:
add or edit the environment varialbe PYTHONPATH to include the desired directory
Move this package to C:\Python24\Lib\site-packages (a more proper place) and create a .pth file with the directory name in it.
Actually the .pth file will probably work if you put it in C:\Python24\pymqi-0.5d\pymqi-0.5d\.
Of course, none of this is any help if you simply don't have pymqe, CMQC, or CMQCFC modules/files.
Dec 12 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.