2

I have some problem in installing the package in python.

I made a python package itself like this

def joke():
    return ('test')

and save it with the name __init__.py then I upload to pypi and I have the massage that:

Submitting dist/funni3st-0.2.tar.gz to https://pypi.python.org/pypi
Server response (200): OK

then I tried to install the package using pip

sudo pip install funni3st

Collecting funni3st
  Downloading funni3st-0.2.tar.gz
Installing collected packages: funni3st
  Running setup.py install for funni3st ... done
Successfully installed funni3st-0.2

I tried to run this package in spyder python, I have the massage

import funni3st
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named funni3st

anyone can help me what's wrong with my python module?

Thank you

4
  • Are you sure you are running and installed the package into Python2 and not Python3, or vice-versa? Commented Dec 19, 2016 at 5:26
  • I'm sure its python 2.7, my computer doesn't installed python 3 Commented Dec 19, 2016 at 5:28
  • Might be recommended to write / learn Python3 if you are just starting. There's doesn't seem to be a reason to limit your module to Python2 Commented Dec 19, 2016 at 5:37
  • try 'pip freeze' command to list all the installed packages - check if funni3est is there. Commented Dec 19, 2016 at 6:46

2 Answers 2

2

import funniest

This should work. It seems that packaged with a wrong name.

Sign up to request clarification or add additional context in comments.

Comments

2
$ pip2 install funni3st
Requirement already satisfied: funni3st in /usr/local/lib/python2.7/site-packages

Looks like you named it funniest

$ cat /usr/local/lib/python2.7/site-packages/funniest/__init__.py

def joke():
    return (u'Wenn ist das Nunst\u00fcck git und Slotermeyer? Ja! ... '
            u'Beiherhund das Oder die Flipperwaldt gersput.')

And works fine, by the way

In [1]: import funniest

In [2]: funniest.joke()
Out[2]: u'Wenn ist das Nunst\xfcck git und Slotermeyer? Ja! ... Beiherhund das Oder die Flipperwaldt gersput.'

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.