1

Downloaded scrypt-0.8.0 onto a Centos 7 system. I'm using Anaconda 2.7.12 version of python located in my home directory. After untarring the scrypt file, I ran 'python setup.py install'. The build and installation completed without any indication of errors. I then started the python interpreter and entered 'import scrypt'. An ImportError exception was thrown with a message 'No module named _scrypt'.

I opened up the .egg file that was created and saw there was a file _scrypt.so. I also went into the original build directory and saw the files scrypt.py and _scrypt.so. In that directory, I started python again, did the import command, and was successful in importing the package and in running some scrypt examples. This tells me that the file was built correctly and was installed correctly.

Why isn't python able to find the module?

sizzzzlerz
  • 4,277
  • 3
  • 27
  • 35
  • It didn't work right after installing but after restarting python it worked fine... so whats the problem? – Tadhg McDonald-Jensen Jun 13 '17 at 16:11
  • 1
    No. In order to get it to load, I had to move into the build directory created by setup.py and run python from there where the file is located (local directory is searched before python's default directories). Moving to any other directory, where python's default paths are used, results in the failed import. – sizzzzlerz Jun 13 '17 at 16:20
  • ok so it did build but didn't install correctly since it didn't get put in a standard path. That is odd, could you try importing scrypt from normal directory, catch the error then check what `sys.modules["scrypt"].__file__` shows, that will show where it imported the python module. I'd expect the `.so` to be put nearby. – Tadhg McDonald-Jensen Jun 13 '17 at 16:33
  • I'm not sure about it not being in the standard path. The install put the egg file scrypt-0.8.0-py2.7-linux-x86_64.egg into the site-packages directory. Inside this egg file are several .py files, the compiled .pyc files and the _scrypt.so file. In site-packages, a new file, easy-install.pth, was created and it's only line is the relative path of the egg file (./scrypt-...egg). It looks correct to me but I'm not real familar with egg files. – sizzzzlerz Jun 13 '17 at 17:40

0 Answers0