简体   繁体   English

使用麻线和滚轮将python包上传到PYPI时发生导入错误

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

I have a python package ready for distribution on PyPI. 我有一个准备在PyPI上分发的python软件包。 To do this I am using twine as recommended on the in the Python docs. 为此,我使用Python文档中推荐的twine I have my setup.py file and this previously worked using the setup.py register upload command for my previous release. 我有我的setup.py文件,以前可以使用我先前版本的setup.py register upload命令来工作。

To upload on to PyPi I am using: 要上传到PyPi,我正在使用:

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: 我去了Libs / site-packages,我所看到的是:

在此处输入图片说明

ie no folder called PyCoTools , just the dist info. 即没有名为PyCoTools文件夹,只有dist信息。

and inside that I just have 在我里面 在此处输入图片说明

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 谢谢

did you forget to put init .py inside your pyCoTools directory ? 您是否忘记将init .py放入pyCoTools目录中? I had the same issue and I resolved it by adding this file. 我遇到了同样的问题,并通过添加此文件解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM