LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   pymills install (https://www.linuxquestions.org/questions/linux-software-2/pymills-install-645892/)

leroy27336 05-30-2008 01:47 PM

pymills install
 
I am trying to install the pymills-3.4 module. The tarball comes packed with a setup.py script. The script is as follows:

#!/usr/bin/env python

import os
import re

name = os.path.basename(os.getcwd())
pkg = __import__(name)

try:
import ez_setup
ez_setup.use_setuptools()
print "Using ez_setup"
except ImportError:
pass

try:
from setuptools import setup, find_packages
print "Using setuptools"
except ImportError:
print "Using distutils"
from distutils.core import setup

# borrowed from pymills.utils
def getFiles(paths, tests=[os.path.isfile], pattern=".*", \
include_path=True):
"""getFiles(path, tests=[os.path.isfile], pattern=".*", \
include_path=True) -> list of files

Return a list of files in the specified path
applying the predicates listed in tests returning
only the files that match the pattern.
"""

def testFile(file):
for test in tests:
if not test(file):
return False
return True

list = []
for path in paths:
if not os.path.exists(path):
continue
files = os.listdir(path)
for file in files:
if testFile(os.path.join(path, file)) and \
re.match(pattern, file):
if include_path:
list.append(os.path.join(path, file))
else:
list.append(file)
return list

def main():
setup(
name=name,
version=pkg.__version__,
description=pkg.__description__,
long_description=pkg.__doc__,
author=pkg.__author__,
author_email=pkg.__author_email__,
maintainer=pkg.__maintainer__,
maintainer_email=pkg.__maintainer_email__,
url=pkg.__url__,
download_url=pkg.__download_url__,
classifiers=pkg.__classifiers__,
license=pkg.__license__,
keywords=pkg.__keywords__,
platforms=pkg.__platforms__,
packages=find_packages(),
scripts=getFiles(["scripts"]),
install_requires=pkg.__install_requires__,
setup_requires=pkg.__setup_requires__,
extras_require=pkg.__extras_require__,
entry_points=pkg.__entry_points__,
package_data=pkg.__package_data__,
)

if __name__ == "__main__":
main()


Everytime I try to run the script, I receive the following error message:

Traceback (most recent call last):
File "setup.py", line 7, in <module>
pkg = __import__(name)
ImportError: No module named pymills-3.4


I don't understand what I need to know. Obviously there isn't going to be a module named pymills, because that is what I am trying to install.

Any help is appreciated.

reddazz 06-02-2008 05:46 AM

What commands did you run to install it? Have you tried
Code:

python setup.py --install
or
Code:

python setup.py install


All times are GMT -5. The time now is 09:35 PM.