module name not recognized

Darren Dale dd55 at cornell.edu
Sun Oct 10 13:35:03 EDT 2004


Darren Dale wrote:

> I have built two basic modules using distutils. One of them installs fine,
> but the other, I can't import modules from it. I've been pouring over the
> code and I cant find the problem.
> 
> I know the file has been copied to site-packages/mypackage, but I cant do
> 
> from mypackage import mymodule
> 
> Could I get suggestions as to why a module would be installed but not
> registered?
> 
> Thanks,
> Darren


Here is some more information. I tried changing the name of my package. It
was called simCTR, and stored in the simCTR directory, and installed
accordingly by distutils. import statements fail because the directory of
my test script is searched during the import request, but the site-packages
directory is not. 

I renamed the package to simctr, installed, and the import statements
succeed. I didnt want to make this name change permanent, so I deleted the
site-packages/simctr directory, tried to install simCTR again, and it
fails.

/usr/lib/python2.3/site-packages/simCTR:
total 64
-rw-r--r--  1 root root  1248 Oct 10 12:56 __init__.py
-rw-r--r--  1 root root  1952 Oct 10 12:56 __init__.pyc
-rw-r--r--  1 root root  7805 Oct  8 16:00 fresnel.py
-rw-r--r--  1 root root  8062 Oct 10 12:51 fresnel.pyc
-rw-r--r--  1 root root 10235 Oct  8 16:00 kinematic.py
-rw-r--r--  1 root root 14011 Oct 10 12:51 kinematic.pyc
-rw-r--r--  1 root root  3795 Oct  5 12:53 spaceGroups.py
-rw-r--r--  1 root root  4381 Oct 10 12:51 spaceGroups.pyc

/usr/lib/python2.3/site-packages/simctr:
total 64
-rw-r--r--  1 root root  1248 Oct 10 13:17 __init__.py
-rw-r--r--  1 root root  1952 Oct 10 13:19 __init__.pyc
-rw-r--r--  1 root root  7805 Oct 10 13:17 fresnel.py
-rw-r--r--  1 root root  8062 Oct 10 13:19 fresnel.pyc
-rw-r--r--  1 root root 10235 Oct 10 13:17 kinematic.py
-rw-r--r--  1 root root 14011 Oct 10 13:19 kinematic.pyc
-rw-r--r--  1 root root  3795 Oct 10 13:17 spaceGroups.py
-rw-r--r--  1 root root  4381 Oct 10 13:19 spaceGroups.pyc


Thanks,
Darren



More information about the Python-list mailing list