Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

marmoset fails to start when installed via setuptools #57

Open
ghost opened this issue Feb 22, 2016 · 0 comments
Open

marmoset fails to start when installed via setuptools #57

ghost opened this issue Feb 22, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 22, 2016

After installing marmoset with setuptools, manually working around #52 , marmoset is unable to be started via the script provided:

root@archlinux:~/marmoset# marmoset.py
Traceback (most recent call last):
  File "/usr/bin/marmoset.py", line 7, in <module>
    __import__('pkg_resources').run_script('marmoset==0.5.0', 'marmoset.py')
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 724, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1650, in run_script
    exec(code, namespace, namespace)
  File "/usr/lib/python3.5/site-packages/marmoset-0.5.0-py3.5.egg/EGG-INFO/scripts/marmoset.py", line 7, in <module>
    marmoset.run()
AttributeError: module 'marmoset' has no attribute 'run'

The issue is the one I discussed earlier with @bastelfreak , since the script has the same name as the provided package, it only works if the script is in the same directory as the package "marmoset". Since the current directory is always first in the path, it will import the script itself otherwise. To demonstrate this, I added the run function to the script in "/usr/lib/python3.5/site-packages/marmoset-0.5.0-py3.5.egg/EGG-INFO/scripts/marmoset.py":

 def run():
     print("Ich bin nur das Skript!")
root@archlinux:~/marmoset# marmoset.py
Ich bin nur das Skript!

The easiest way to solve this would probably be to rename the python package to differ from the actual script name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants