Reputation: 109
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
Upvotes: 2
Views: 298
Reputation: 191884
$ 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.'
Upvotes: 2
Reputation: 1856
import funniest
This should work. It seems that packaged with a wrong name.
Upvotes: 2