ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have installed a new module for Python (pycrypto) and when I run
the following:
python -c "import Crypto.Random"
I receive the error:
ImportError: No module named OSRNG
Now in the __init__.py file is - import OSRNG (obviously the offending line)
My question is: Are you able to import simply the module required by name if it exists as part of the module you have called or is Python looking up some kind of table / list that may have not been updated with the fact that OSRNG exists?
Python will first look in the current working directory and then in the paths specified by sys.modules. Any modules you install should be installed in the site-packages directory of the python installation. I have never used pycrypto so I don't know what it's dependecies but it looks like your missing the OSRNG module from your python installation
Having a closer look at PyCrypto reveals that OSRNG is a package of PyCrypto and should be in site-packages/Crypto/Random so I don't think you have a complete install of PyCrypto. If you reinstall it using your distros pacakge manager then it should fix the issue
Hi kathar, unfortunately being so old this post is not particularly relevant anymore as both Python and Pycrypto have undergone several updates in this time.
My suggestion would be to contact the pycrypto guys, as I found them all very helpful, and they should be able to assist.
As for my solution, as mentioned I found compile issues in the pycrypto source but currently I am at a loss to remember exactly what they were (sorry)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.