隐藏包中的额外导入

时间:2017-04-26 00:08:16

标签: python pip package pypi

我有一个允许输入很多噪音的包裹。我曾尝试使用__all__之类的:

__all__ = ["WebdriverChauffeurMixin", "ChromeDriver", "FirefoxDriver"]

但这没有帮助:

cchilders:~/projects/webdriver_chauffeur (master) 
$ pip uninstall webdriver-chauffeur
Can't uninstall 'webdriver-chauffeur'. No files were found to uninstall.

cchilders:~/projects/webdriver_chauffeur (master) 
$ pip uninstall webdriver_chauffeur
Can't uninstall 'webdriver-chauffeur'. No files were found to uninstall.

In [2]: from webdriver_chauffeur import 
BeautifulSoup            Keys                     os
By                       Select                   random
ChromeDriver             TimeoutException         subprocess
EC                       WebDriverWait            time
FirefoxDriver            WebdriverChauffeurMixin  webdriver

包裹在pypi上,但也在我的机器上~/projects/webdriver_chauffeur

套餐位于https://github.com/codyc4321/webdriver_chauffeur

如何隐藏这些不必要的进口商品?谢谢

1 个答案:

答案 0 :(得分:1)

这似乎是ipython问题,而不是__all__问题。根据此GitHub issue,此行为为configurable(尽管该选项已弃用)。