# 需要導入模塊: from pip import wheel [as 別名]

# 或者: from pip.wheel import Wheel [as 別名]

def from_line(cls, name, comes_from=None, prereleases=None):

"""Creates an InstallRequirement from a name, which might be a

requirement, directory containing 'setup.py', filename, or URL.

"""

url = None

name = name.strip()

req = None

path = os.path.normpath(os.path.abspath(name))

link = None

if is_url(name):

link = Link(name)

elif os.path.isdir(path) and (os.path.sep in name or name.startswith('.')):

if not is_installable_dir(path):

raise InstallationError("Directory %r is not installable. File 'setup.py' not found." % name)

link = Link(path_to_url(name))

elif is_archive_file(path):

if not os.path.isfile(path):

logger.warn('Requirement %r looks like a filename, but the file does not exist', name)

link = Link(path_to_url(name))

# If the line has an egg= definition, but isn't editable, pull the requirement out.

# Otherwise, assume the name is the req for the non URL/path/archive case.

if link and req is None:

url = link.url_without_fragment

req = link.egg_fragment #when fragment is None, this will become an 'unnamed' requirement

# Handle relative file URLs

if link.scheme == 'file' and re.search(r'\.\./', url):

url = path_to_url(os.path.normpath(os.path.abspath(link.path)))

# fail early for invalid or unsupported wheels

if link.ext == wheel_ext:

wheel = Wheel(link.filename) # can raise InvalidWheelFilename

if not wheel.supported():

raise UnsupportedWheel("%s is not a supported wheel on this platform." % wheel.filename)

else:

req = name

return cls(req, comes_from, url=url, prereleases=prereleases)

python wheel使用_Python wheel.Wheel方法代碼示例相关推荐

  1. python markdown2 样式_Python markdown2.markdown方法代碼示例

    本文整理匯總了Python中markdown2.markdown方法的典型用法代碼示例.如果您正苦於以下問題:Python markdown2.markdown方法的具體用法?Python markd ...

  2. python socketio例子_Python socket.SocketIO方法代碼示例

    本文整理匯總了Python中socket.SocketIO方法的典型用法代碼示例.如果您正苦於以下問題:Python socket.SocketIO方法的具體用法?Python socket.Sock ...

  3. python unescape函数_Python escape.url_unescape方法代碼示例

    本文整理匯總了Python中tornado.escape.url_unescape方法的典型用法代碼示例.如果您正苦於以下問題:Python escape.url_unescape方法的具體用法?Py ...

  4. python linspace函数_Python torch.linspace方法代碼示例

    本文整理匯總了Python中torch.linspace方法的典型用法代碼示例.如果您正苦於以下問題:Python torch.linspace方法的具體用法?Python torch.linspac ...

  5. python里turtle.circle什么意思_Python turtle.circle方法代碼示例

    本文整理匯總了Python中turtle.circle方法的典型用法代碼示例.如果您正苦於以下問題:Python turtle.circle方法的具體用法?Python turtle.circle怎麽 ...

  6. python的from_bytes属性_Python parse.quote_from_bytes方法代碼示例

    本文整理匯總了Python中urllib.parse.quote_from_bytes方法的典型用法代碼示例.如果您正苦於以下問題:Python parse.quote_from_bytes方法的具體 ...

  7. python中startout是什么意思_Python socket.timeout方法代碼示例

    本文整理匯總了Python中gevent.socket.timeout方法的典型用法代碼示例.如果您正苦於以下問題:Python socket.timeout方法的具體用法?Python socket ...

  8. python dict get default_Python locale.getdefaultlocale方法代碼示例

    本文整理匯總了Python中locale.getdefaultlocale方法的典型用法代碼示例.如果您正苦於以下問題:Python locale.getdefaultlocale方法的具體用法?Py ...

  9. pythonitems方法_Python environ.items方法代碼示例

    本文整理匯總了Python中os.environ.items方法的典型用法代碼示例.如果您正苦於以下問題:Python environ.items方法的具體用法?Python environ.item ...

  10. python helper方法_Python io_utils.ImportHelper方法代碼示例

    # 需要導入模塊: from bpy_extras import io_utils [as 別名] # 或者: from bpy_extras.io_utils import ImportHelper ...

最新文章

  1. dae模型如何合并_FBX、DAE模型的格式、导入与骨骼动画
  2. python怎么导入时间-Python,模块导入方式和time模块的使用
  3. 支持向量机SVM原理
  4. 干就行了!!!写程序就像珊瑚,分支太多,哪有那么多复用!
  5. getter/setter_Getters / Setters。 邪恶。 期。
  6. 天才基本法_《天才基本法》强推!年度神仙小说,看完这本书我竟然爱上了数学...
  7. CSS:盒子模型和清除float浮动的三种常用方法
  8. Web前端笔记-移动端触屏移动视角(two.js)
  9. android 视网膜黄斑检查 amsler,自测黄斑病变 | 一张图搞定
  10. 深入解析Mysql 主从同步延迟原理及解决方案
  11. 关于“客户感知价值提升”的思考(三)---电商渠道客户感知管理方法探讨
  12. Objective-C Runtime 运行时之一:类与对象
  13. 答题小程序学习,题库答题类小程序,云开发+cms做后台,有错题集,积分排名,做题进度
  14. Word删除表格后空白页的方法
  15. 统计学怎么求加权指数_统计学课程作业(统计指数)
  16. CocosCreator如何制作微信小游戏
  17. ubuntu 开机进不去桌面问题
  18. 4年老用户!从R9s Plus换到Find X3,这些体验太上头
  19. 一个纸杯子的测试用例
  20. 电商后台:商品管理系统

热门文章

  1. 根据一个属性,剔除 Json 中重复元素(删除 JSON 中重复的部分)
  2. maxN - 返回数组中N个最大元素 minN - 返回数组中N个最小元素
  3. Struts2的工作原理及工作流程
  4. PHP中header函数的用法及其注意重点是什么呢
  5. css3 loading 效果1
  6. JS 学习笔记--11---内置对象(Global/Math)
  7. 神马是线程?PHP对其具体的应用?应用在哪里?
  8. ODT .NET 详解之 SqlDataSource 访问 Oracle
  9. Booster 系列之——多线程优化
  10. Kotlin 学习笔记08