【问题标题】:How can I autocomplete Softimage code from PyCharm?如何从 PyCharm 自动完成 Softimage 代码?
【发布时间】:2015-06-22 11:23:29
【问题描述】:

我正在关注Conquering the code in Softimage XSI tutorials 为 Softimage 编写 Python 插件(在 Windows 上)。

我想在我的首选编辑器 (PyCharm) 中编辑代码,但我注意到 PyCharm 无法自省 Softimage 类/模块并提供自动完成功能。有什么方法可以让 PyC​​harm 了解 Softimage 的内部结构吗?

【问题讨论】:

  • softimage SDK 是您的PYTHONPATH 的一部分吗?
  • @BurhanKhalid 好主意,现在来看看 SDK 的路径是什么 :)

标签: python windows pycharm


【解决方案1】:

将项目解释器设置为 C:\Program Files\Autodesk\Softimage\Application\python\python.exe 成功了(感谢 @BurhanKhalid 询问 PYTHONPATH)。所有基于 Softimage 的补全现在都可以工作了。

其他库

就我而言,我还需要额外的 Python 库。这可以通过两种方式实现:

  1. 创建一个 virtualenv。 使用 PyCharm,创建一个基于 Softimage 解释器的 virtualenv。将其他库添加到 virtualenv。

  2. 克隆解释器。C:\Program Files\Autodesk\Softimage\Application\python\ 复制到C:\Python26SoftimageClone\。使用 PyCharm,将包管理添加到克隆的解释器(文件 | 设置 .... | 项目 | 项目解释器 | “安装打包工具”)。通过 PyCharm 接口添加库。

适用于 Windows 的古怪库

我选择了选项 2,因为我需要的两个库引起了额外的复杂性:PyQt4 和 MySQLdb(又名 MySQL-python)。我安装它们如下:

C:\>cd\Python26SoftimageClone\Scripts C:\Python26SoftimageClone\Scripts>pip install C:\Users\name\Downloads\MySQL_python-1.2.5-cp26-none-win_amd64.whl

我现在拥有 Softimage 内置函数、PyQt4 和 MySQLdb 的自动完成功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-13
    • 2018-08-27
    • 2014-03-14
    • 1970-01-01
    • 2015-05-27
    • 2014-07-22
    • 2014-08-26
    • 1970-01-01
    相关资源
    最近更新 更多