Search code examples
pythonuploadpypitwine

Import error when using twine and wheel to upload python package to PYPI


I have a python package ready for distribution on PyPI. To do this I am using twine as recommended on the in the Python docs. I have my setup.py file and this previously worked using the setup.py register upload command for my previous release.

To upload on to PyPi I am using:

python setup.py sdist
python setup.py bdist_wheel
twine upload dist\PyCoTools-2.1.2-py2-none-any.whl  #this was created in the previous line

Now, on another computer I try using:

pip install PyCoTools 

and it installs but then:

>>> import PyCoTools

Gives an import error. I go to the Libs/site-packages and all I see is this:

enter image description here

i.e. no folder called PyCoTools, just the dist info.

and inside that I just have enter image description here

Which (obviously) doesn't incude the files that are in my package. Could anybody give me some pointers as to what I'm doing wrong?

Thanks


Solution

  • did you forget to put init.py inside your pyCoTools directory ? I had the same issue and I resolved it by adding this file.