简体   繁体   中英

pip cannot find module that is in pypi

I have created a python module, i2cdev .

When I try to install it through pip, I get that it cannot find it:

$ pip3 search "i2cdev"  # finds it fine
i2cdev                    - Simple I2C Library for linux
$ pip3 install i2cdev
Collecting i2cdev
  Could not find any downloads that satisfy the requirement i2cdev
  No distributions at all found for i2cdev

What is going on?

wow, I'm an idiot. Apparently you have to use setup.py sdist upload to actually upload the code onto python. I thought just registering it was enough.

You have to setup download link for the tarball/zip file which is uploaded.You can check it by

http://pypi.python.org/simple/<package name>

Because pip searches in this above url .If There is no download links, You have to add download_link as metadata .That is something like

in setup.py

setup(...,
     download_url = 'http://pypi/path/to/package.tar.gz',

     )

I found out, your's is

https://pypi.python.org/packages/source/i/i2cdev/i2cdev-1.2.4.tar.gz

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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