1

I'm trying to package a simple app I wrote, so that it can be installed on a system using python setup.py install and (later) using pip install awesomeapp.

The app consists of two files in the same directory:

awesomeapp
awesomemod.py

where awesomeapp is the starter script (also in python) which does import awesomemod. Everything works and is generally awesome. Next I created a setup.py file which looks something like this:

from distutils.core import setup
setup(name='awesomeapp',
  version='1.4',
  scripts=['awesomeapp'],
  py_modules=['awesomemod'],
  install_requires=['otherapp>1.0'],
  description='amazing app which does awesome things',
  # ...
  platforms='UNIX',
  long_description='bar',
  )

Now, the installation with sudo python setup.py install (and also with pip) executes without errors. On OSX everything works as expected. However on Ubuntu (tested with precise and trusty), I get the error:

traceback (most recent call last):
  File "/usr/local/bin/awesomeapp", line 12, in <module>
    import awesomemod
ImportError: No module named awesomemod

when I run the awesomeapp script. However if I run the script using sudo the module is found. The module is installed in /usr/local/lib/python2.7/dist-packages with -rw-r----- permissions which cannot be read by my non-root user. What do I need to change so that normal users do not need root to run my app?

1 Answer 1

1

It seems I found the culprit in my .bash_profile file. It included the entry

umask 027

After commenting the line out, the permissions are fixed!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .